The prefixes used in an XPath expression are resolved separately from those in a document. This is accomplished via an org.w3c.dom.xpath.XPathNSResolver (see the Xalan api). If you don't care about namespaces, use the local-name function:
self::*[local-name()='foo']/child::*[local-name()='bar' and @id='2']/... The XPath recommendation: http://www.w3.org/TR/xpath gives a comprehensive overview. Hth. -Nikhil Paul Tomsic wrote: > perhaps this is more of a xalan thing, but i'm hoping > someone here might be able to help. > > i'm querying nodes via xpath > XPathAPI.selectSingleNode(Node, String) where the > string is the xpath "foo/[EMAIL PROTECTED]'2']/baz" > > that fails if the node has a default namespace or if > the nodes in the xpath belong to a miriad of > namespaces. > as a result, i need to change that to > "a:foo/b:[EMAIL PROTECTED]'2']/c:baz" > > does anyone know if there's a way to either (a) > determine each node's namespace and make it part of > the xpath, or (b) simply have the node disregard the > namespaces entirely for the sake of xpath'ing? > > thanks > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
