Subject: Re: [xsl] XSLT code for function fn:fold-right() From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 13 Mar 2019 11:29:41 -0000 |
Hi all,
B B Please look at following link, for description of XPath 3.1 functionB fn:fold-right(),
https://www.w3.org/TR/xpath-functions-31/#func-fold-right
Within this function's description, its mentioned The effect of the function is equivalent to the following implementation or its equivalent in XSLT:
<xsl:function name="fn:fold-right" as="item()*">
B <xsl:param name="seq" as="item()*"/>
B <xsl:param name="zero" as="item()*"/>
B <xsl:param name="f" as="function(item(), item()*) as item()*"/>
B <xsl:choose>
B B <xsl:when test="fn:empty($seq)">
B B B <xsl:sequence select="$zero"/>
B B </xsl:when>
B B <xsl:otherwise>
B B B <xsl:sequence select="$f(fn:head($seq), fn:fold-right(fn:tail($seq), $zero, $f))"/>
B B </xsl:otherwise>
B </xsl:choose>
</xsl:function>
I've a feeling, that above XSLT logic of this function may be wrong (particularly the line <xsl:sequence select="$f(fn:head($seq), fn:fold-right(fn:tail($seq), $zero, $f))"/>. But I'll appreciate if anyone may point me wrong).
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] XSLT code for function fn:fol, Mukul Gandhi gandhi. | Thread | Re: [xsl] XSLT code for function fn, Mukul Gandhi gandhi. |
[xsl] XSLT code for function fn:fol, Mukul Gandhi gandhi. | Date | Re: [xsl] XSLT code for function fn, Mukul Gandhi gandhi. |
Month |