[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] XSLT 3.0: Example of contains redundant parameters

Subject: [xsl] XSLT 3.0: Example of <xsl:evaluate> contains redundant parameters
From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 7 Feb 2015 04:20:13 -0000

 The last example in section 10.4.5 "Examples of xsl:evaluate" of the
2nd Last Call of the W3C "XSLT 3.0" specification, at:


is this:

     <xsl:function name="f:function-lookup">
       <xsl:param name="name" as="xs:QName"/>
       <xsl:param name="arity" as="xs:integer"/>
       <xsl:evaluate xpath="'Q{' || namespace-uri-from-QName($name) || '}'
                      || local-name-from-QName($name) || '#' || $arity">
         <xsl:with-param name="name" as="xs:QName" select="$name"/>
         <xsl:with-param name="arity" as="xs:integer" select="$arity"/>

And this function can be called and produces the expected results.

However, the two <xsl:with-param> children of <xsl:evaluate> in this
example, are not needed, because the target expression, when
constructed, doesn't contain any variable references.


1. The example can be simplified by removing the two <xsl:with-param>
elements, and will be improved and made more clear as result of this

2. This means that the specification at present lacks an example of
<xsl:evaluate> where the target expression, after its construction,
contains variable references, although the above example may lead the
reader mistakenly believe, that this is exactly such example.

I hope that both point 1, and 2 above could be reflected and improved
in a future version of this document, by removing the unnecessary
<xsl:with-param> elements and by adding a new example, in which the
constructed target expression truly contains variable references.

Dimitre Novatchev.

Current Thread