[jdom-interest] XPath helper

Laurent Bihanic laurent.bihanic at atosorigin.com
Mon Apr 28 08:38:33 PDT 2003


Hi,

Attached is a proposal for adding a new helper class: 
org.jdom.contrib.helpers.XPathHelper.
This class provides utility methods to build XPath expressions to select a 
given JDOM node.
The generated XPaths can be evaluated using JDOM org.jdom.xpath.XPath. Direct 
use of Jaxen requires redefining the prefix-URI mapping for namespaces (i.e. 
calling XPath.addNamespace() for each namespace in the path) as Jaxen does not 
perform context mapping.

As always with such automatically generated expressions, the built XPaths rely 
on the document structure and are thus only valid as long as this structure 
does not change.

Laurent

-------------- next part --------------
A non-text attachment was scrubbed...
Name: XPathHelper.java
Type: text/x-java
Size: 18396 bytes
Desc: not available
Url : http://jdom.org/pipermail/jdom-interest/attachments/20030428/db320fb3/XPathHelper.bin


More information about the jdom-interest mailing list