xsl:if test for null string giving TransformerException

R

Robert Kattke

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>
<xsl:eek:therwise>
<a>
<xsl:attribute name="href">
<xsl:value-of select="site"/>
</xsl:attribute>Website
</a>
</xsl:eek:therwise>

</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(ElemChoose.java:162)
at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2182)at
.... xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:678)
...

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

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(Operation.java:146)
at org.apache.xpath.Expression.bool(Expression.java:208)
at org.apache.xpath.XPath.bool(XPath.java:388)
... 66 more
 
R

Robert Kattke

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.
 
R

Robert Kattke

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 ).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top