This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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@attbi.com]
Sent: Thursday, January 31, 2002 8:43 PM
To: xsl-list@lists.mulberrytech.com
Subject: Re: [xsl] NullPointerException?


I don't see any obvious errors in there, but you might try the changes I gave
in a response to one of your other emails.  Since you are using Xalan, you
might try running your stylesheet with org.apache.xalan.xslt.Process (if you
aren't already) and give it the -TT, -TTC, -TG, and/or -TS command line
options.  These will spit out trace information (-TT and -TTC are probably
the most useful) that will let you figure out where in your stylesheet the
problem occurs.  Could you post the results here?

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>"&#38;</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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]