.. _namespace-uri: ============= 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. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:node() - Examples ~~~~~~~~ .. list-table:: :widths: 25 25 50 :header-rows: 1 * - **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 - .. list-table:: :widths: 50 50 :header-rows: 1 * - **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 ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`node-name`. * :ref:`namespace-uri-for-prefix`. * :ref:`namespace-uri-from-QName`. * :ref:`functx_namespaces-in-use`.