473,893 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsl:if test for null string giving TransformerExce ption

I'm getting a TransformerExce ption 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 ***

65 <xsl:when test="site = ''">
<xsl:otherwis e>
<xsl:attribut e name="href">
<xsl:value-of select="site"/>
</xsl:attribute>W ebsite


~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~
; SystemID: ; Line#: 65; Column#: 34
javax.xml.trans form.Transforme rException: Unknown error in XPath
at org.apache.xpat h.XPath.bool(XP ath.java:411)
at org.apache.xala n.templates.Ele mChoose.execute (ElemChoose.jav a:162)
at org.apache.xala n.transformer.T ransformerImpl. executeChildTem plates(Transfor merImpl.java:21 82)at
.... xalan.templates .ElemLiteralRes ult.execute(Ele mLiteralResult. java:678)


at org.apache.xpat h.objects.XNode Set.compare(XNo deSet.java:619)
at org.apache.xpat h.objects.XNode Set.equals(XNod eSet.java:706)
at org.apache.xpat h.operations.Eq uals.operate(Eq uals.java:82)
at org.apache.xpat h.operations.Op eration.execute (Operation.java :146)
at org.apache.xpat h.Expression.bo ol(Expression.j ava:208)
at org.apache.xpat h.XPath.bool(XP ath.java:388)
... 66 more
java.lang.NullP ointerException

Maybe there is a better way to check for blank or null string.
TIA for you suggestions and references.
Jul 20 '05 #1
2 8718
> I'm getting a TransformerExce ption 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.trans form.Transforme rException: 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
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

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> <xsl:number count="LoanRecord" format="1"/><br/> Loan ID:<xsl:value-of select="loan_no"> </xsl:value-of><br/> Calculated CLTV:<xsl:value-of select="format-number (curr_balance div
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"/> On the XSLt file relayed to this XML, i wrote in green the attribute value if Attribute "Esito" is "Ok". I mean, something, like this:
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>
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 test="$var:v141=&quot;true&quot;"> <!-- This doesn't work --> <xsl:if test="string($var:v141)=&quot;true&quot;">
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 tried <xsl:if test="ToutCompris = true"> and it does'nt work either
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 Step</title> <author>Michael Halvorsen</author> <subject>Programming</subject>
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 report (header no value). How do I test for this? <xsl:if test="Test"> <xsl:if test="Test"> <b><xsl:text>Header: </xsl:text></b>
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 DIVIDERS</description> <note>Description of problem here</note>
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 FTP'd to my web host when the Access database is changed. I'm using Dreamweaver to create an XSLT fragment to read the XML file and include the HTML output into my ASP page. It works fine to display the XML data, the School Closings, in my web page. ...
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 and then the xslt sample code that is not matching. please look and if it jumps right off the page give me a tip on why it didnt select the data. i think for most xslt people this will be easy. i want the if to work if it is null because
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.