Project

Profile

Help

Bug #2932

closed

NullPointerException when an xsl:package contains an xsl:include

Added by Michael Kay over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT 3.0 packages
Sprint/Milestone:
-
Start date:
2016-09-12
Due date:
% Done:

100%

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

Description

Arises in new test case glob-cxt-item-005, when the containing package is compiled using XsltCompiler.compilePackage().

java.lang.NullPointerException

at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:183)

at net.sf.saxon.style.StylesheetModule.spliceIncludes(StylesheetModule.java:494)

at com.saxonica.ee.packages.PrincipalStylesheetModuleEE.spliceUsePackages(PrincipalStylesheetModuleEE.java:83)

at net.sf.saxon.style.PrincipalStylesheetModule.preprocess(PrincipalStylesheetModule.java:340)

at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:221)

at net.sf.saxon.s9api.XsltCompiler.compilePackage(XsltCompiler.java:485)
Actions #1

Updated by Michael Kay over 7 years ago

The xsl:include is being processed correctly during use-when preprocessing of the xsl:package, and the retrieved document is indexed under the absolute URI of the module in the Compilation object. Then when the main processing (XSLGeneralIncorporate) is done, the module is not found in the Compilation object. The is because the calculation of the key to use for the document index incorrectly takes into account the whitespace stripping rules for the package: it is using DocumentURI.computeDocumentKey() which is also used for the document cache supporting the doc() function. The doc() function now delivers different documents for the same URI based on the whitespace stripping rules of the containing package, but this logic isn't relevant for the cache of stylesheet modules.

Actions #2

Updated by Michael Kay over 7 years ago

  • Status changed from New to Resolved
  • Applies to branch 9.7, 9.8 added
  • Fix Committed on Branch 9.7, 9.8 added

Fixed by adding an argument to DocumentFn.computeDocumentKey() to indicate whether whitespace stripping rules for the package should be taken into account.

Actions #3

Updated by O'Neil Delpratt over 7 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.7.0.10 added

Bug fix applied in the Saxon 9.7.0.10 maintenance release

Actions #4

Updated by O'Neil Delpratt almost 7 years ago

  • Applies to branch deleted (9.8)
  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF