namespace-uri

The namespace URI of a node

Description

The fn:namespace-uri function returns the namespace part of the element or attribute name. This is the namespace that is mapped to its prefix, or the default namespace if it is unprefixed. If the element or attribute name is not in a namespace, a zero-length string is returned.

Parameters

Description

arg:node()

Examples

XPath

Results

Explanation

namespace-uri($in-xml)

zero-length xs:anyURI value

the noNamespace element itself

namespace-uri($in-xml//pre:prefixed)

datypic.com > Pre

namespace-uri($in-xml//unpre:unprefixed)

datypic.com > Unpre

namespace-uri($in-xml//@pre:prefAttr)

datypic.com > Pre

namespace-uri($in-xml//@noNSAttr)

zero-length xs:anyURI value

XPath

Results

namespace-uri($in-xml)

zero-length xs:anyURI value

namespace-uri($in-xml//pre:prefixed)

datypic.com > Pre

namespace-uri($in-xml//unpre:unprefixed)

datypic.com > Unpre

namespace-uri($in-xml//@pre:prefAttr)

datypic.com > Pre

namespace-uri($in-xml//@noNSAttr)

zero-length xs:anyURI value

See Also