Would it be reasonable to add something like saxon:force-type="yes" to
xsl:stylesheet element? -- it would signal an error when "as" is missed on
xsl:variable, xsl:param or xsl:function declarations inside the
I am willing to enhance my XSLT code w/ strongly typed variables, hoping it
will help to catch bugs more quickly.
Can you please suggest me the the correct "as" value for:
if I put as="element()*" it does not seem to work like it did before
This is a case where as="" does not merely declare the expected type, it
changes the behaviour from the XSLT 1.0 "result tree fragment" behaviour,
which implicitly creates a document node. The expansion of this is:
<xsl:variable name="x" as="document-node()">
However, are you sure you really need to copy the node? Won't working with the
original node work just as well? In which case you can use <xsl:variable name="var1" select="elm1"/>
Please note that this is an XSLT coding question, nothing specific to Saxon,
so it would be best asked on a general XSLT forum such as the xsl-list at
Log in to post a comment.