Skip to main content

Registering Namespaces

When using namespaces, it is important to remember that XPath matches qualified names (QNames) based on the namespace URI, not on the prefix.

Therefore the XPath "//foo:bar" may not find a node named "foo:bar" if the prefix "foo" in the context of the node and in the execution context of the XPath are mapped to different URIs. Conversely, "//foo:bar" will find the node named "biz:bar", if "foo" in the execution context and "biz" in the node context are mapped to the same URI.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!