[jdom-interest] XPath Namespace mappings

Phil Weighill-Smith phil.weighill-smith at volantis.com
Mon Mar 8 06:07:11 PST 2004

Clearly, this is only applicable when you have a document you can apply the path to but you could:
Apply the XPath to a document to obtain a (set of) JDOM "node"(s), then walk up the JDOM hierarchy(ies) getting the namespaces for each of the nodes in the path(s).
Phil :n.

	-----Original Message----- 
	From: Laurent Bihanic [mailto:laurent.bihanic at atosorigin.com] 
	Sent: Mon 08/03/2004 13:47 
	To: Ed Maher 
	Cc: jdom-interest at jdom.org 
	Subject: Re: [jdom-interest] XPath Namespace mappings

	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.
	To control your jdom-interest membership:

More information about the jdom-interest mailing list