Project

Profile

Help

Bug #2416

closed

NPE with expand-text and empty text element

Added by O'Neil Delpratt over 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Internals
Sprint/Milestone:
Start date:
2015-07-15
Due date:
% Done:

100%

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

Description

The following stylsheet throws a Null pointer exception. Reported by Patrik Stellmann:

<xsl:stylesheet xmlns:xsl        = "http://www.w3.org/1999/XSL/Transform"
       version="3.0" expand-text="yes">
       <xsl:template match="/">
               <xsl:text/>
       </xsl:template>
</xsl:stylesheet>

Exception thrown:

java.lang.NullPointerException
	at com.saxonica.config.pe.StyleNodeFactoryPE.compileContentValueTemplate(StyleNodeFactoryPE.java:315)
	at net.sf.saxon.style.XSLText.compile(XSLText.java:101)
	at net.sf.saxon.style.StyleElement.compileSequenceConstructor(StyleElement.java:1833)
	at net.sf.saxon.style.XSLTemplate.compileDeclaration(XSLTemplate.java:447)
	at net.sf.saxon.style.StylesheetPackage.compile(StylesheetPackage.java:1055)
	at net.sf.saxon.style.Compilation.compilePackage(Compilation.java:201)
	at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:94)
	at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:543)
	at net.sf.saxon.Transform.doTransform(Transform.java:601)
	at net.sf.saxon.Transform.main(Transform.java:80)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Fatal error during transformation: java.lang.NullPointerException:  (no message)
Actions #1

Updated by Debbie Lockett over 9 years ago

  • Status changed from New to In Progress
  • Assignee set to Debbie Lockett
Actions #2

Updated by Debbie Lockett over 9 years ago

  • Status changed from In Progress to Resolved
  • Fixed in version set to 9.6

Patch applied to fix the problem on the 9.6 and 9.7 branches. The compile method is updated to handle the case where child is null - to now return a ValueOf instruction whose argument is a zero-length string.

Actions #3

Updated by Debbie Lockett over 9 years ago

Test case expand-text/cvt-031 has been added to the XSLT 3.0 test suite.

Actions #4

Updated by O'Neil Delpratt over 9 years ago

  • Found in version changed from 9.6.0.6 to 9.6
Actions #5

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in version changed from 9.6 to 9.6.0.7

Bug fix applied in the Saxon 9.6.0.7 maintenance release.

Actions #6

Updated by O'Neil Delpratt about 9 years ago

  • Applies to branch 9.6 added
  • Fix Committed on Branch 9.6 added
  • Fixed in Maintenance Release 9.6.0.7 added
Actions #7

Updated by O'Neil Delpratt about 9 years ago

  • Sprint/Milestone set to 9.6.0.7

Please register to edit this issue

Also available in: Atom PDF