[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: NullPointerException?
It did turn out to be a bug in Xalan. I reported it as:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6156 Jay -----Original Message----- From: Peter Davis [mailto:pdavis152@xxxxxxxxx] Sent: Thursday, January 31, 2002 8:43 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: NullPointerException?
On Tuesday 29 January 2002 12:33, Jay Burgess wrote: > 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:call-template> > </xsl:variable> > <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:call-template> > </xsl:variable> > <xsl:text>"&</xsl:text><xsl:value-of > select="@name"/><xsl:text>="</xsl:text><xsl:value-of select="$value2"/> > </xsl:template> > > Thanks in advance. > > Jay > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list -- Peter Davis If only one could get that wonderful feeling of accomplishment without having to accomplish anything. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|