The namespace-uri() function returns a string that represents the URI of the namespace in the expanded name of a node. Typically, this will be a URI used in a namespace declaration, that is, the value of an xmlns or xmlns:* attribute in the source XML.
For example, if you apply this function to the outermost element of an XSLT stylesheet by writing the expression «namespace-uri(document(' ')/*) » , the result will be the string « http://www.w3.org/1999/XSL/Transform » .
Argument | Data Type | Meaning |
---|---|---|
node (optional) | node()? | Identifies the node whose namespace URI is required. If the argument is an empty sequence, the function returns a zero-length string If the argument is omitted, the target node is the context node. It is then an error if there is no context item, or if the context item is not a node |
Result | xs:string | The namespace URI of the expanded name of the target node |