[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath error with Xalan

  • To: <xml-dev@l...>
  • Subject: XPath error with Xalan
  • From: "Thomson, Alisa" <Thomson@f...>
  • Date: Fri, 5 Nov 2004 07:50:37 -0500
  • Thread-index: AcTDNgwpmXESdCj7SkGzrQIozJPHlg==
  • Thread-topic: XPath error with Xalan

unknown error in xpath
Title: XPath error with Xalan

I have a template that was producing the exact output I need except that I need the elements to be optional.  So, if an element is empty it should not be processed.  I tried several different methods of testing to see if an element is empty…all of which work fine through XMLSpy (using the MSXML parser); however, will Xalan all of the methods break with the following exception:

ERROR [2004-11-04 14:48:54,608] [woods][TFO] : PDFGenerator.generatePDF::Caught
TransformerException; SystemID: file:///c:/Projects/Eneg/dev/templates/couponRows.xsl; Line#: 56; Column#: 41
javax.xml.transform.TransformerException: Unknown error in XPath
        at org.apache.xpath.XPath.bool(XPath.java:411)
        at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:198)
        at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2182)
        at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:678)

Here are two samples of methods I tried:

  <xsl:if test="Determination[. != '']">
    <xsl:apply-templates select="Determination"/>
  </xsl:if>

  <xsl:if test="string()">
    <xsl:apply-templates select="Determination"/>
  </xsl:if>

I also tried placing the Xalan jar in the java_home/lib/endorsed directory like the Xalan docs specify for JDK1.4 with the same results.

Below is the EnvironmentCheck output from Xalan:

C:\Projects\Eneg\dev\scripts\batch>java org.apache.xalan.xslt.EnvironmentCheck
#---- BEGIN writeEnvironmentReport($Revision: 1.14 $): Useful stuff found: ----
version.DOM.draftlevel=2.0fd
java.class.path=C:/Projects/Eneg/dev/dist/enegotiated.jar;C:/Projects/Eneg/dev/d
ist/enegotiated_web.jar;C:/bea/jdk141_05/lib/tools.jar;C:/Projects/Eneg/dev/lib/
log4j-1.2.4.jar;C:/Projects/Eneg/dev/lib/xerces.jar;C:/Projects/Eneg/dev/lib/fop
.jar;C:/Projects/Eneg/dev/lib/avalon-framework-4.1.5.jar;C:/Projects/Eneg/dev/li
b/batik.jar;C:/bea/weblogic81/server/lib/jConnect.jar;C:/bea/weblogic81/server/l
ib/jconn2.jar;C:/Projects/Eneg/dev/java/ear/war/WEB-INF/classes
version.JAXP=1.1
java.ext.dirs=C:\Program Files\Java\j2re1.4.2_03\lib\ext
version.xerces2=not-present
version.xerces1=Xerces 1.4.4
version.xalan2_2=Xalan Java 2.4.1
version.xalan1=not-present
version.ant=not-present
java.version=1.4.2_03
version.DOM=2.0
version.crimson=present-unknown-version
sun.boot.class.path=C:\Program Files\Java\j2re1.4.2_03\lib\rt.jar;C:\Program Fil
es\Java\j2re1.4.2_03\lib\i18n.jar;C:\Program Files\Java\j2re1.4.2_03\lib\sunrsas
ign.jar;C:\Program Files\Java\j2re1.4.2_03\lib\jsse.jar;C:\Program Files\Java\j2
re1.4.2_03\lib\jce.jar;C:\Program Files\Java\j2re1.4.2_03\lib\charsets.jar;C:\Pr
ogram Files\Java\j2re1.4.2_03\classes
#---- BEGIN Listing XML-related jars in: foundclasses.java.class.path ----
xerces.jar-path=C:\Projects\Eneg\dev\lib\xerces.jar
xerces.jar-apparent.version=xerces.jar from xalan-j_2_2_0
#----- END Listing XML-related jars in: foundclasses.java.class.path -----
version.SAX=2.0
version.xalan2x=Xalan Java 2.4.1
#----- END writeEnvironmentReport: Useful properties found: -----
# YAHOO! Your environment seems to be OK.

Any ideas would be appreciated.

Thanks,
Ci-Ci


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.