cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <b.molenk...@bizzdesign.nl>
Subject RE: JXPath
Date Wed, 02 Feb 2005 13:14:21 GMT
I think that JXPath doesn't understand the cocoon:/ scheme. You should
use the source resolver, resolve the source,
Parse it, and pass the document to JXPathContext.newContext();
 
-----Original Message-----
From: Roberto [mailto:rmarra@montefiore.ch] 
Sent: Wednesday, February 02, 2005 11:42 AM
To: users@cocoon.apache.org
Subject: JXPath
 
Hi cocoon developers,
Im trying to use JXPath to read the value of xml file in a flow, like
that:
 
    var context =
org.apache.commons.jxpath.JXPathContext.newContext("cocoon:/xmldata/user
s.xml");
    var value =
toString(context.getValue("autentication/users/user[@id='1']/pwd"));
The xml file is:
 
<autentication>
<users>
<user id="1">
<userName type="internal" lang="it">Roberto</userName>
<pwd>pippo</pwd>
</user>
</autentication>
 
The problem is that the value variable is null. What's wrong with me?
 
Thanx in advance
Cheers
Roberto

Mime
View raw message