You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Anders Samuelson <an...@aspiro.com> on 2003/04/24 15:46:49 UTC
Problem with XPath expression using JDK1.4.1 with Xalan 2.2 and higher
Hi,
Given the follwing extract of a xml page -
<?xml version="1.0" encoding="UTF-8"?>
<page user-id="User1" service="Login" session="41845463" base-url="servlets/WUDisp" cache-time="0">
<page-area id="pa1" title="Login">
<paragraph id="p1">
<action id="a1" text="Ok" type="internal" service="MNU" function="Main" button="accept"/>
</paragraph>
</page-area>
</page>
- I'm trying to access the 'base-url' and 'session' attributes of the page element with the XPath expression {/page/@base-url} and {/page/@session}.
(For the complete java code and stylesheet see attachments. Execute the java class with the command:
java -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl TransformTest)
This works fine using JDK 1.4.1 and putting Xalan 2.1 and Xercex 1.4.3 in the endorsed directory. However using any later versions e.g. Xalan 2.5 together with Xerces 2.4 fails. The expressions evaluate to "" instead of the values given in the xml source.
I'm not using any default namespace so there should be no issues there?!
Any help solving this problem is greatly appreciated!
Cheers,
Anders
------------------------------
Aspiro AB
Anders Samuelson, M Sc
Box 118
S-201 21 Malmö
Sweden
Mobile: +46 709 918017
Fax: +46 40 579771
http://www.aspiro.com <http://www.aspiro.com/>
---------------------------