Project

Profile

Help

Bug #4324

closed

java.lang.NullPointerException when attribute xsl:use-package/@name is absent

Added by Gerben Abbink almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2019-09-28
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
9.9, trunk
Fix Committed on Branch:
9.9, trunk
Fixed in Maintenance Release:
Platforms:

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

NULL.xsl (180 Bytes) NULL.xsl Gerben Abbink, 2019-09-28 10:20
Actions #1

Updated by Gerben Abbink almost 5 years ago

I have attached the XSLT (NULL.xsl).

Actions #2

Updated by Michael Kay almost 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.

Actions #3

Updated by O'Neil Delpratt over 4 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

Also available in: Atom PDF