[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]


Subject: NullPointerException?
From: Jay Burgess <jburgess@xxxxxxxxxxxxxx>
Date: Tue, 29 Jan 2002 14:33:25 -0600
transformerimpl.java nullpointerexception
After upgrading my version of Xalan yesterday, I've started having null pointer exceptions in a Java app doing XSL transformation. Since I'm still somewhat new to XSL, I assume the problem is in my XSL, not with Xalan. First, here's the stack trace:

[java] javax.xml.transform.TransformerException: java.lang.NullPointerException
[java] at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1230)
[java] at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:642)
[java] at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1092)
[java] at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1070)
[java] at XMLConfig.traverse(XMLConfig.java:172)
[java] at XMLConfig.traverse(XMLConfig.java:177)
[java] at XMLConfig.traverse(XMLConfig.java:177)
[java] at XMLConfig.main(XMLConfig.java:46)

The template is below (it's a simple escape/encode routine for name/value pairs in the query string of a URL). From my preliminary debugging, it appears that the line "<xsl:with-param name="inString" select="string($value1)"/>" is the culprit. It's almost as though value2 is trying to set itself before value1 has been fully defined. Is this possible? If so, do you see any obvious errors in or workarounds for my code?

<xsl:template name="param">
<xsl:variable name="value1">
<xsl:call-template name="encode">
<xsl:with-param name="inString" select="string(.)"/>
<xsl:with-param name="oldChars" select="'%'"/>
<xsl:with-param name="newChars" select="'%25'"/>
<xsl:variable name="value2">
<xsl:call-template name="encode">
<xsl:with-param name="inString" select="string($value1)"/>
<xsl:with-param name="oldChars" select="' '"/>
<xsl:with-param name="newChars" select="'%20'"/>
<xsl:text>"&#38;</xsl:text><xsl:value-of select="@name"/><xsl:text>="</xsl:text><xsl:value-of select="$value2"/>

Thanks in advance.


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.