XSLT and XPath function reference in alphabetical order

(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 5, translated from German)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z



Functions in connection with qualified identifiers (QNames)


XPath 2.0

Return value:

A xs:string string; the URI string of one of the namespaces valid for the element passed on which is designated by the prefix also passed on.


fn:namespace-uri-for-prefix($prefix, $element)


Obligatory. A xs:string string which represents a namespace prefix, which means it must be lexically of xs:NCName type. An empty string is permitted as value and represents the (prefixless) default namespace.


Obligatory. A node of element() type.

Purpose of use:

If the considered element node has a valid namespace to which the prefix passed on as first argument is assigned, the fn:namespace-uri-for-prefix() function returns the URI string of the so designated namespace as xs:anyURI.

The determination of the equality between a prefix passed on to the function and a prefix used on an element is done by means of their Unicode character values (Unicode Codepoints). If there is no namespace in the scope of the element to which the prefix passed on is assigned, the function returns an empty sequence.

If the empty string (not the empty sequence!) is passed on as prefix argument, the namespace URI is accordingly returned to which no prefix is assigned, which means the default namespace.

Function definition:

XPath 1.0:

The function is not available.

XPath 2.0:

fn:namespace-uri-for-prefix($prefix as xs:string?, $element as element()) as xs:anyURI?


<< back next >>




Copyright © Galileo Press, Bonn 2008
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSLT 2.0 & XPath 2.0" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.

Galileo Press, Rheinwerkallee 4, 53227 Bonn, Germany