473,385 Members | 1,325 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 8681
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lizard | last post by:
OK, total newbie here, so this may be a mind-numbingly dumb question AND I may be phrasing it badly. I have an xsl:template which looks like this: <xsl:template match="LoanRecord"> <hr>...
9
by: Andrea Maschio | last post by:
Hi, i have a terrible noobie frustration formatting an XML file like this: <Dipendente Id="1" Anno="2003" Nome="pippo" Cognome="pippi" Nato_il="10/03" Email="pippo@emailprovider.it" Esito="ok"/>...
2
by: Jørn Tommy Kinderås | last post by:
I need to get nodes in a xml file that match one out of two parameters...but how can I create a or statemement with <xsl:if>? E.G ---xml-- ... <movie> <title>T2</title> </movie> <movie>
3
by: Eric Theil | last post by:
I'm at my wit's end with this one. Within an xsl:if test, I'm not able to get 2 variables to properly evaluate if one of them is wrapped within a string function. <!-- This works --> <xsl:if...
2
by: websls | last post by:
I tried to do this : <xsl:if test="ToutCompris"> some output </xsl:if> ToutCompris is a boolean element in my XML file My problem is the output is parse even when ToutCompris is false I...
5
by: Luke Vogel | last post by:
Hi all, Probably a really basic question, but I cant find an answer ... I have an xml file of books something like: <product> <isbn>0-735-61374-5</isbn> <title>Microsoft Visual Basic Step By...
1
by: Fred | last post by:
Hi, I am using XSL if to look and see if a node exists and if so display it with a header (see below). Some of the xml I transforming has nodes like this <Test /and it shows up in my html...
4
by: Doulos05 | last post by:
Ok, this seems like it should be easy, but it has escaped me. Here is my xml file: <ref_sheet> <item> <date>2007/04/06</date> <product>124567</product> <description>TAB...
4
by: grbeal | last post by:
How do I test for a child element with xsl if condition? We have a vendor application that outputs an XML file containing records of School Closings due to inclement weather. That XML file gets...
3
by: z1 | last post by:
hi- i am fooling around with soap and weather templates. for some reason either this if or select is failing. i am very new to xml and found this code at another site. i can show you the xml...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.