Return namespace URI from node.
fn:namespace-uri(node $node) => anyURI
fn:namespace-uri => string
This function returns the namespace URI of a node if it is qualified by a
namespace. If $node
is present, it returns its namespace URI,
otherwise it returns the namespace URI of the context node. If the respective
node is not qualified, the function returns the empty string.
$node |
node |
---|
Retrieve namespace URI from previously declared namespace:
declare namespace dotcom = "http://company.dot.com/namespaces/corporate" namespace-uri(<dotcom:bookshelf/>)
The query returns the namespace URI http://company.dot.com/namespaces/corporate.
Retrieve namespace URI from unqualified namespace:
namespace-uri(<unqualified/>)
This query returns the empty string.
The following construct(s) refer to this construct: