[jdom-interest] XPath Namespace mappings

Laurent Bihanic laurent.bihanic at atosorigin.com
Mon Mar 8 05:47:36 PST 2004


Ed Maher wrote:
> Is there any good way to extract the namespace mappings from an XPath 
> interface ?
>  
> I have an XPath interface which I am passing around, and at some point I 
> wish to extract the
> namespace mappings (prefix, uti) from it to pass to another system, or 
> to build another XPath expression.

Neither JDOM's nor Jaxen's XPath objects have methods to retrieve the 
configured namespaces.

When dealing with namespaces, I usually code a method to allocate XPath 
objects that also takes care of adding all the namespaces used by the 
application to every created XPath instance.

Laurent



More information about the jdom-interest mailing list