namespace-uri-for-prefix
The namespace associated with a prefix, in the scope of an element
Description
The fn:namespace-uri-for-prefix function returns the namespace mapped to $prefix, using the in-scope namespaces of $el e ment. If $prefix is a zero-length string or the empty sequence, the function returns the default namespace, if any.
Parameters |
Description |
---|---|
prefix:string() |
the prefix to check for |
element:element() |
the element to use as the scope |
Examples
XPath |
Results |
---|---|
namespace-uri-for-prefix(‘’, $in-xml) |
() |
namespace-uri-for-prefix(‘pre’,$in-xml) |
() |
namespace-uri-for-prefix(‘pre’,$in-xml//pre:prefixed) |
|
namespace-uri-for-prefix( ‘’,$in-xml//unpre:unprefixed) |
|
namespace-uri-for-prefix( ‘pre’,$in-xml//unpre:unprefixed) |