On Tuesday 22 June 2004 17:10, you wrote:
> Document doc = ...;
> XPath xpath = doc.createXPath("/html:html/html:head/html:title");
> // manually tell the xpath about our prefix
> xpath.setNamespaceContext(Collections.singletonMap("html",
> "http://www.w3.org/1999/xhtml";);

There's no XPath.setNamespaceContext(Map).

> Element titleElem = (Element)xpath.selectSingleNode(doc);

Can't I simply ignore the namespace somehow? I want to apply one XPath 
expression to all docs.

As I workaround I could do a

Node n = 
dom.selectSingleNode("/HTML/*[local-name()='HEAD']/*[local-name()='TITLE']");

but this is ugly... :-(


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to