469,292 Members | 1,310 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,292 developers. It's quick & easy.

xsl:if test for null string giving TransformerException

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

</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: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(Oper ation.java:146)
at org.apache.xpath.Expression.bool(Expression.java:2 08)
at org.apache.xpath.XPath.bool(XPath.java:388)
... 66 more
---------
java.lang.NullPointerException

Maybe there is a better way to check for blank or null string.
TIA for you suggestions and references.
Jul 20 '05 #1
2 8533
> 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.
Jul 20 '05 #2
<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 ).
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Andrea Maschio | last post: by
2 posts views Thread by Jørn Tommy Kinderås | last post: by
3 posts views Thread by Eric Theil | last post: by
2 posts views Thread by websls | last post: by
5 posts views Thread by Luke Vogel | last post: by
1 post views Thread by Fred | last post: by
4 posts views Thread by Doulos05 | last post: by
4 posts views Thread by grbeal | last post: by
3 posts views Thread by z1 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.