You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Monsorno <li...@exolution.de> on 2004/07/01 11:25:48 UTC

strange error when processing stylesheets: tomcat, jdk1.4, windows, xalan

Hi *,

I get the following error when trying to transform a xml document with
a XSLT stylesheet:

    ; SystemID: jndi:/localhost/ipas/xsl/minutes_pdf.xsl; Line#: 298; Column#: 66
    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)
    ...

In the stylesheet, I test for an empty string:

    <xsl:if test="not(string(./title))">

The error occurs:

- with ANY test condition that tests for an empty string
  (e.g. with "string-length(./entry) = 0"
- with having xalan.jar, xml-apis.jar and xercesImpl.jar in my
  WEB-INF/lib from any xalan versions of 2.5.0, 2.5.2, 2.6.0
- with Tomcat 4.1.29 on Windows 2000 and JDK 1.4x
- NOT with JDK 1.3
- NOT on Linux
- NOT with resin

It's these kind of errors that makes being a programmer a real fun!

Does anyone have a tip on what to do?  

-- 
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: strange error when processing stylesheets: tomcat, jdk1.4, windows, xalan

Posted by Dan Barron <db...@ddive.com>.
Have you tried just testing (title) instead of (./title)?  The added "./" 
seems unneceassry.

At 02:25 AM 7/1/2004, you wrote:
>Hi *,
>
>I get the following error when trying to transform a xml document with
>a XSLT stylesheet:
>
>     ; SystemID: jndi:/localhost/ipas/xsl/minutes_pdf.xsl; Line#: 298; 
> Column#: 66
>     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)
>     ...
>
>In the stylesheet, I test for an empty string:
>
>     <xsl:if test="not(string(./title))">
>
>The error occurs:
>
>- with ANY test condition that tests for an empty string
>   (e.g. with "string-length(./entry) = 0"
>- with having xalan.jar, xml-apis.jar and xercesImpl.jar in my
>   WEB-INF/lib from any xalan versions of 2.5.0, 2.5.2, 2.6.0
>- with Tomcat 4.1.29 on Windows 2000 and JDK 1.4x
>- NOT with JDK 1.3
>- NOT on Linux
>- NOT with resin
>
>It's these kind of errors that makes being a programmer a real fun!
>
>Does anyone have a tip on what to do?
>
>--
>Martin
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Re: strange error when processing stylesheets: tomcat, jdk1.4, windows, xalan

Posted by Jacob Kjome <ho...@visi.com>.
Quoting Martin Monsorno <li...@exolution.de>:

> Martin Monsorno <li...@exolution.de> writes:
> 
> > Hi *,
> >
> > I get the following error when trying to transform a xml document with
> > a XSLT stylesheet:
> >
> >     ; SystemID: jndi:/localhost/ipas/xsl/minutes_pdf.xsl; Line#: 298;
> Column#: 66
> >     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)
> >     ...
> >
> > In the stylesheet, I test for an empty string:
> >
> >     <xsl:if test="not(string(./title))">
> >
> > The error occurs:
> >
> > - with ANY test condition that tests for an empty string
> >   (e.g. with "string-length(./entry) = 0"
> > - with having xalan.jar, xml-apis.jar and xercesImpl.jar in my
> >   WEB-INF/lib from any xalan versions of 2.5.0, 2.5.2, 2.6.0
> > - with Tomcat 4.1.29 on Windows 2000 and JDK 1.4x
> > - NOT with JDK 1.3

Well, this should be obvious by now.  JDK1.4+ ships with Xalan.  As such, it is
an "endorsed" library.  You shouldn't be putting endorsed libraries in
WEB-INF/lib.  Since Tomcat adds Xerces and xml-apis to common/endorsed, they
become "endorsed" libraries as well.  Tomcat classloaders will actively ignore
endorsed libraries sitting in WEB-INF/lib.  As such, your own versions of the
libraries are doing nothing whatsoever being there.  If you want to update
Tomcat with the latest Xerces and xml-apis, delete the existing ones from
common/endorsed and add yours there.  You can also add Xalan there, but probably
should add it to JAVA_HOME/jre/lib/endorsed (create the directory if it doesn't
already exist).  I suggest you use the "2jars" release to avoid making BCel
(which Xalan ships with... and old version at that) an endorsed library.  If
things don't work after this, then I'm at a loss.

> > - NOT on Linux
> > - NOT with resin
> 
> Ah, yes, and it does NOT occur when running the transforming by
> directly calling xalan from the command line and not via TomCat!
> 


Jake


> 
> --
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: strange error when processing stylesheets: tomcat, jdk1.4, windows, xalan

Posted by Martin Monsorno <li...@exolution.de>.
Martin Monsorno <li...@exolution.de> writes:

> Hi *,
>
> I get the following error when trying to transform a xml document with
> a XSLT stylesheet:
>
>     ; SystemID: jndi:/localhost/ipas/xsl/minutes_pdf.xsl; Line#: 298; Column#: 66
>     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)
>     ...
>
> In the stylesheet, I test for an empty string:
>
>     <xsl:if test="not(string(./title))">
>
> The error occurs:
>
> - with ANY test condition that tests for an empty string
>   (e.g. with "string-length(./entry) = 0"
> - with having xalan.jar, xml-apis.jar and xercesImpl.jar in my
>   WEB-INF/lib from any xalan versions of 2.5.0, 2.5.2, 2.6.0
> - with Tomcat 4.1.29 on Windows 2000 and JDK 1.4x
> - NOT with JDK 1.3
> - NOT on Linux
> - NOT with resin

Ah, yes, and it does NOT occur when running the transforming by
directly calling xalan from the command line and not via TomCat!


-- 
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org