Project

Profile

Help

Deadcode <xsl:copy> throws static error

Added by Vladimír Šišma almost 8 years ago

Hello, the following source code throws the static error for the element xsl:copy as the result of the compilation. I think a warning would be enough, similar to the warning for xsl:sequence. I tried last Saxon (HE, PE, EE) 9.6.0-9, 9.7.0-5.

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:variable name="v" as="element(a)*"/> <xsl:for-each-group group-by="name()" select="$v"> <xsl:copy-of select="."/> xsl:copy/ </xsl:for-each-group> </xsl:template> </xsl:stylesheet>

Warning at char 1 in xsl:copy-of/@select on line 5 column 34 of main.xsl: SXWN9000: Evaluation will always fail: there is no context item Static error at char 1 in xsl:copy-of/@select on line 5 column 34 of main.xsl: XTTE0945: No context item supplied for xsl:copy Errors were reported during stylesheet compilation

The code is automatically generated and I don't want generate special code for empty variable "v".

Best regards, V.Sisma


Replies (1)

    (1-1/1)

    Please register to reply