.. _namespace-uri-for-prefix: ======================== 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. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - prefix:string() - the prefix to check for * - element:element() - the element to use as the scope Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - namespace-uri-for-prefix('', $in-xml) - () * - namespace-uri-for-prefix('pre',$in-xml) - () * - namespace-uri-for-prefix('pre',$in-xml//pre:prefixed) - http://datypic.com/pre * - namespace-uri-for-prefix( '',$in-xml//unpre:unprefixed) - http://datypic.com/unpre * - namespace-uri-for-prefix( 'pre',$in-xml//unpre:unprefixed) - http://datypic.com/pre See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`in-scope-prefixes`. * :ref:`functx_namespaces-in-use`. * :ref:`resolve-QName`. * :ref:`namespace-uri`. * :ref:`namespace-uri-from-QName`.