I've added a helper method to the XPath interface allowing the mapping of
prefixes to namespace URIs to be specified for an XPath query. This feature
is in CVS and in the daily build; it will be available in a full release
soon.

Here's an example of it in action...

// make the map of prefixes to namespace URIs
Map uris = new HashMap();
uris.put( "SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/"; );
uris.put( "m", "urn:xmethodsBabelFish" );

// create a namespace aware xpath
XPath xpath = document.createXPath(
"/SOAP-ENV:Envelope/SOAP-ENV:Body/m:BabelFish" );
xpath.setNamespaceURIs( uris );

Node element = xpath.selectSingleNode( document );


James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to