A hack is to extend org.jaxen.dom.DocumentNavigator and override:
a) getNamespacePrefix and getNamespaceStringValue to return "" and null.
b) translateNamespacePrefixToUri to return null (if you want to disable
namespaces in the XPath expression as well).
Of course, the 'cleaner' way is to use the local-name(), e.g.
/*[local-name()='bar' and @name='something']
ptomsic wrote:
> is it possible to have the DOMXPath disregard namespaces, such that if i were
> to have an XML that contained
>
> <foo:bar name="something"/>
> <foo:baz>
> <foo:zing>targetValue</foo:zing>
> </foo:baz>
> </foo:bar>
>
> is there a way for me to do the following:
>
> XPath path = new DOMXPath("/bar[@name='something']/baz/zing/text()");
> path.selectSingleNode(domDoc);
>
> to obtain "targetValue"
>
> ?
>
> thanks
>
>