DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=28796>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28796 XSLTC: exsl:node-set gives null pointer exception when casting a string to a text node Summary: XSLTC: exsl:node-set gives null pointer exception when casting a string to a text node Product: XalanJ2 Version: 2.5Dx Platform: PC OS/Version: Windows XP Status: NEW Severity: Normal Priority: Other Component: org.apache.xalan.xsltc AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] According to the documentation at http://www.exslt.org/exsl/functions/node-set/, the exslt node-set function should be able to turn a string into a text node. Thus, the following stylesheet should be legal: <?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common"> <xsl:output method="xml" encoding="US-ASCII" /> <xsl:template match="/"> <xsl:variable name="text">Some text</xsl:variable> <xsl:apply-templates select="exsl:node-set($text)" /> </xsl:template> </xsl:stylesheet> However, an attempt to execute this stylesheet with XSLTC (from Xalan 2.6.0) causes a NullPointerException: ERROR: '' <?xml version="1.0" encoding="US-ASCII"?>javax.xml.transform.TransformerException: java.lang.NullPointerException at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:613) at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:286) at Test.main(test.java:62) Caused by: java.lang.NullPointerException at org.apache.xalan.xsltc.dom.DOMAdapter.getExpandedTypeID(DOMAdapter.java:232) at org.apache.xalan.xsltc.dom.MultiDOM.getExpandedTypeID(MultiDOM.java:431) at KtPageLayout_EN.applyTemplates() at KtPageLayout_EN.template$dot$0() at KtPageLayout_EN.applyTemplates() at KtPageLayout_EN.transform() at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580) at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:606) ... 2 more --------- java.lang.NullPointerException at org.apache.xalan.xsltc.dom.DOMAdapter.getExpandedTypeID(DOMAdapter.java:232) at org.apache.xalan.xsltc.dom.MultiDOM.getExpandedTypeID(MultiDOM.java:431) at KtPageLayout_EN.applyTemplates() at KtPageLayout_EN.template$dot$0() at KtPageLayout_EN.applyTemplates() at KtPageLayout_EN.transform() at org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.java:580) at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:606) at org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:286) at Test.main(test.java:62) With the Xalan 2.6.0 interpretive processor, this stylesheet causes a stackoverflow exception. I'm not quite sure why. Change the template's match="/" attribute to something like match="dx:element", and it works as expected with the interpretive processor (although it still gives a NullPointerException with XSLTC). Perhaps I'm missing something obvious? Further background information: the source document that I'm using to reproduce this is passed to the stylesheet as a DOMSource, built with Xerces. -- Daniel Neades Araxis Ltd www.araxis.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
