Bug #4107
closedXTSE0090: Attribute @select is not allowed on element <xsl:evaluate>
100%
Description
I'm using the version Saxon-HE 9.9.0.1J. And I read the documentation at https://www.saxonica.com/html/documentation/xsl-elements/evaluate.html There, the example contains a line
<xsl:evaluate select="$product-sort-key"/>
but it results in the above error, because xsl:evaluate does not allow an '@select' attribute.
Of course I know that the Home Edition of Saxon does not support xsl:evaluate', but executing the sample results in a 'NullPointerException' like in the following StackTrace:
Static error in xsl:evaluate/@select on line 7 column 47 of b.xslt:
XTSE0090: Attribute @select is not allowed on element xsl:evaluate
Static error at xsl:evaluate on line 7 column 47 of b.xslt:
XTSE0010: Element must have an @xpath attribute
java.lang.NullPointerException
at net.sf.saxon.expr.parser.TypeChecker.staticTypeCheck(TypeChecker.java:74)
at net.sf.saxon.style.XSLEvaluate.validate(XSLEvaluate.java:199)
at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1716)
at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1751)
at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1720)
at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1751)
at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1720)
at net.sf.saxon.style.StyleElement.validateChildren(StyleElement.java:1751)
at net.sf.saxon.style.StyleElement.validateSubtree(StyleElement.java:1720)
at net.sf.saxon.style.XSLTemplate.validateSubtree(XSLTemplate.java:594)
at net.sf.saxon.style.PrincipalStylesheetModule.preprocess(PrincipalStylesheetModule.java:403)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:289)
at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:258)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:107)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:778)
at net.sf.saxon.Transform.doTransform(Transform.java:722)
at net.sf.saxon.Transform.main(Transform.java:82)
Fatal error during transformation: java.lang.NullPointerException: (no message)`
Updated by Michael Kay almost 6 years ago
- Category set to Documentation
- Assignee set to Debbie Lockett
- Priority changed from Low to Normal
Thank you for reporting this. The documentation is wrong: it should say:
<xsl:evaluate xpath="$product-sort-key"/>
We'll fix this, and also look at the NPE which of course shouldn't occur on a user error.
Updated by Michael Kay almost 6 years ago
- Status changed from New to In Progress
- Applies to branch trunk added
- Fix Committed on Branch trunk added
I have committed a patch on 9.9 and trunk which fixes the NPE; it was failing on the recovery path after reporting the error.
Updated by Michael Kay almost 6 years ago
Documentation example fixed on 9.9 and trunk.
Updated by Michael Kay almost 6 years ago
- Status changed from In Progress to Resolved
- Assignee changed from Debbie Lockett to Michael Kay
Updated by Debbie Lockett almost 6 years ago
9.9 documentation updated online (XML and HTML versions).
Updated by O'Neil Delpratt over 5 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.9.1.2 added
Bug issue fixed in the Saxon 9.9.1.2 maintenance release.
Please register to edit this issue