#978 xsl:copy when context item is undefined

Michael Kay

If xsl:copy is used when the context item is undefined (for example, within xsl:function), then (a) if it is known statically that the context item is undefined, Saxon fails at compile time with a NullPointerException during the optimize() phase of processing; (b) if the situation is not known statically, xsl:copy is a null operation: it completes without error.

The XSLT 2.0 specification is not explicit about this situation. In the W3C bugzilla entry 7624 I have proposed adding a new error code XTTE0945, and a patch is being raised in Subversion for the 9.2 and 9.1 branches that has this effect. Test cases copy903err and copy904err have been submitted to the W3C test suite to test the static and dynamic cases respectively.


  • Michael Kay

    Michael Kay - 2009-10-22

    Fixed in

  • Michael Kay

    Michael Kay - 2009-10-29

    Also fixed in


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks