Bug #4324
closedjava.lang.NullPointerException when attribute xsl:use-package/@name is absent
0%
Description
I get a NullPointerException when running this stylesheet using the Saxon command prompt. I am using SaxonHE9-9-1-5J.
Stylesheet:
<xsl:package version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:use-package package-version="whatever"/> </xsl:package>
XML: same as stylesheet
Stack: java.lang.NullPointerException at net.sf.saxon.style.XSLUsePackage.findUsedPackage(XSLUsePackage.java:44) at net.sf.saxon.style.PrincipalStylesheetModule.gatherOverridingDeclarations(PrincipalStylesheetModule.java:525) at net.sf.saxon.style.PrincipalStylesheetModule.spliceUsePackages(PrincipalStylesheetModule.java:487) at net.sf.saxon.style.PrincipalStylesheetModule.preprocess(PrincipalStylesheetModule.java:331) at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:286) at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:222) at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:107) at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:785) at net.sf.saxon.Transform.doTransform(Transform.java:741) at net.sf.saxon.Transform.main(Transform.java:80) Fatal error during transformation: java.lang.NullPointerException: (no message)
Files
Updated by Gerben Abbink about 5 years ago
I have attached the XSLT (NULL.xsl).
Updated by Michael Kay about 5 years ago
- Subject changed from java.lang.NullPointerException to java.lang.NullPointerException when attribute xsl:use-package/@name is absent
- Category set to Diagnostics
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Fix Committed on Branch 9.9, trunk added
Thanks for reporting it. I have changed the error recovery path that handles the situation where xsl:use-package/@name
is omitted so that the NPE no longer occurs, and I have added a test case (use-package-296) to the XSLT3 test suite.
Updated by O'Neil Delpratt almost 5 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 9.9.1.6 added
Patch committed to the Saxon 9.9.1.6 maintenance release.
Please register to edit this issue