To retrieve a node that has been place in a namespace, you _must_ specify
the same namespace in your XPath. You do that by using a prefix in the
XPath string, and by providing a prefix resolution context which maps that
prefix into the same namespace URI that was used in the document. In the
simple version of the XPathAPI call you're using, the parent node will be
used as the prefix resolver context; any namespace prefixes declared on or
above that parent node should be picked up and used. If you need to
reference namespaces which aren't defined at that level, you'll have to use
one of the fancier versions of the XPathAPI:
selectSingleNode(contextNode,string,namspaceNode)
Here, the namespaceNode may be any DOM node, so if you don't already have a
node handy which has all the proper namespace context you can fall back on
hand-generating a DOM node which does.
Lower-level calls such as XPathAPI.eval() allow you to plug in hand-coded
prefix-to-namespace resolvers, if that ever becomes necessary..
______________________________________
Joe Kesselman / IBM Research