Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xsl:if test for null string giving TransformerException

Reply
Thread Tools

xsl:if test for null string giving TransformerException

 
 
Robert Kattke
Guest
Posts: n/a
 
      04-08-2004
I'm getting a TransformerException when running Tomcat and calling a
Servlet that use XML to create DOM and XSL to create webpage.

I'm posting just the snippet of XSL code and the Error here. Full
listing should be in my next thread. Funny thing is from a command
line I can run Process without an error. Why would Tomcat hiccup and
belch ?
Maybe I should be investigating my JARs in the classpath ?
*** note error occurring in ln 65 ***

<xsl:choose>
65 <xsl:when test="site = ''">
<xsl:text>N/A</xsl:text>
</xsl:when>
<xsltherwise>
<a>
<xsl:attribute name="href">
<xsl:value-of select="site"/>
</xsl:attribute>Website
</a>
</xsltherwise>

</xsl:choose>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
; SystemID: ; Line#: 65; Column#: 34
javax.xml.transform.TransformerException: Unknown error in XPath
at org.apache.xpath.XPath.bool(XPath.java:411)
at org.apache.xalan.templates.ElemChoose.execute(Elem Choose.java:162)
at org.apache.xalan.transformer.TransformerImpl.execu teChildTemplates(TransformerImpl.java:2182)at
.... xalan.templates.ElemLiteralResult.execute(ElemLite ralResult.java:67
...

....
....
....

at org.apache.xpath.objects.XNodeSet.compare(XNodeSet .java:619)
at org.apache.xpath.objects.XNodeSet.equals(XNodeSet. java:706)
at org.apache.xpath.operations.Equals.operate(Equals. java:82)
at org.apache.xpath.operations.Operation.execute(Oper ation.java:146)
at org.apache.xpath.Expression.bool(Expression.java:2 0
at org.apache.xpath.XPath.bool(XPath.java:38
... 66 more
---------
java.lang.NullPointerException

Maybe there is a better way to check for blank or null string.
TIA for you suggestions and references.
 
Reply With Quote
 
 
 
 
Robert Kattke
Guest
Posts: n/a
 
      04-09-2004
> I'm getting a TransformerException when running Tomcat and calling a
> Servlet that use XML to create DOM and XSL to create webpage.
> 65 <xsl:when test="site = ''"> Error on this line


Also tried this variation
<xsl:when test="string-length(site) > 0">

still getting:
; SystemID: ; Line#: 65; Column#: 48
javax.xml.transform.TransformerException: Unknown error in XPath

Help - something must not be configured right on my system.
 
Reply With Quote
 
 
 
 
Robert Kattke
Guest
Posts: n/a
 
      04-21-2004
<xsl:when test="string-length(site) > 0"> Error here

> Help - something must not be configured right on my system.

How would I check what actual jar's are being used by Tomcat 4.0.4 on
WXP ?
I'm assumming check my master environment variables and then analyze
the batch files ( possibly using echo to see the classpath ).
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The giving that keeps on giving sixteenmillion C Programming 0 11-19-2007 10:59 PM
javax.xml.transform.TransformerException: Could not find function: empty Abdelhalim Java 2 07-06-2007 10:04 AM
TransformerException, getting the source dado0583@hotmail.com Java 0 03-01-2005 11:46 AM
javax.xml.transform.TransformerException veny Java 0 10-25-2004 05:02 PM
test test test test test test test Computer Support 2 07-02-2003 06:02 PM



Advertisments