Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

XSL sort by result of a template call

FofanaApr 27 2018 — edited May 1 2018

Hi,

I have a question about XSL?

Is it possible to use a result returned from <xsl:call-template> as the sort key? I have been "googling" but no clear answer?

This is my template to return a key_id based on a subscriber_ID

pastedImage_3.png

Now I want to sort doing something like this:

pastedImage_4.png

But it does not work

This is the code if someone want to modify them

<xsl:template name="getKeyParamIdForSubscriptionId">

<xsl:param name="subsIdentifier" />

<xsl:choose>

<xsl:when test="lineItems[subscriptionIdentifier=$subsIdentifier]/subscriptionAttributes[parameter = $keyParamId]/value">

<xsl:value-of select="lineItems[subscriptionIdentifier=$subsIdentifier]/subscriptionAttributes[parameter = $keyParamId]/value" />

</xsl:when>

<xsl:otherwise>

<xsl:value-of select="$subsIdentifier" />

</xsl:otherwise>

</xsl:choose>

</xsl:template>

<xsl:sort />

<xsl:variable name="thisVal">

<xsl:call-template name="getKeyParamIdForSubscriptionId">

<xsl:with-param name="subsIdentifier">

<xsl:value-of select="$subsId" />

</xsl:with-param>

</xsl:call-template>

</xsl:variable>

<result value="{$thisVal}" />

Thanks

This post has been answered by odie_63 on May 1 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 29 2018
Added on Apr 27 2018
3 comments
1,197 views