Actions
Bug #4727
closedNPE on bogus version number
Start date:
2020-09-09
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
10, trunk
Fixed in Maintenance Release:
Platforms:
Description
Consider this stylesheet:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:t="http://example.com/templates"
exclude-result-prefixes="#all"
version="3.0">
<xsl:output omit-xml-declaration="yes"/>
<xsl:use-package name="http://example.com/funcsynopsis"
package-version="'2.0.5'"/>
<xsl:template match="funcsynopsis">
<xsl:call-template name="t:funcsynopsis"/>
</xsl:template>
</xsl:stylesheet>
It produces:
Error at xsl:use-package on line 11 column 45 of pcustom.xsl:
XTSE0020 Error in package-version: For input string: "'2"
java.lang.NullPointerException
at net.sf.saxon.trans.packages.PackageLibrary.findPackage(PackageLibrary.java:183)
at net.sf.saxon.style.XSLUsePackage.findUsedPackage(XSLUsePackage.java:49)
at net.sf.saxon.style.PrincipalStylesheetModule.gatherOverridingDeclarations(PrincipalStylesheetModule.java:531)
at net.sf.saxon.style.PrincipalStylesheetModule.spliceUsePackages(PrincipalStylesheetModule.java:493)
at net.sf.saxon.style.PrincipalStylesheetModule.preprocess(PrincipalStylesheetModule.java:330)
at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:288)
at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:254)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:113)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:838)
at net.sf.saxon.Transform.doTransform(Transform.java:753)
at net.sf.saxon.Transform.main(Transform.java:82)
Fatal error during transformation: java.lang.NullPointerException: (no message)
Updated by Norm Tovey-Walsh over 3 years ago
- Project changed from 4 to Saxon
- Assignee set to Norm Tovey-Walsh
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from New to In Progress
The problem appears to be in attempting to add packages that haven't been found. (In other words, it's not strictly related to the invalid version number in the initial test case.)
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from In Progress to Resolved
- Fix Committed on Branch 10, trunk added
Fixed
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from Resolved to In Progress
Writing a test case for the W3C XSLT test suite revealed another source of an NPE; this time related to the invalid format of the version number.
Updated by Norm Tovey-Walsh over 3 years ago
- Status changed from In Progress to Resolved
Once again resolved; see also the test "package-200" in the W3C xslt30-test repository.
Updated by O'Neil Delpratt over 3 years ago
Bug fix applied in the Saxon 10.3 maintenance release
Updated by O'Neil Delpratt over 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.3 added
Please register to edit this issue
Actions