XML technologies / XSLT / XSLT and XPath functions / Alphabetical XSLT and XPath reference / document-uri

(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

fn:document-uri

Category:

Node names, identifiers and URI information

Origin:

XPath 2.0

Return value:

A xs:string string which corresponds to the absolute URI of the document node passed on.

Call/Arguments:

fn:document-uri($document-node)

$document-node:

A document node whose absolute URI shall be determined. If there is no corresponding absolute URI, the function returns the empty sequence.

Purpose of use:

The absolute URI of a document node passed on is determined according to the accessor function dm:document-uri of the XPath/XQuery data model:

dm:document-uri($node as document-node()) as xs:string?

This accessor function, and thus fn:document-uri(), returns as xs:anyURI URI string the absolute URI of the document node passed on.

In case the empty sequence has been passed on as argument, but a document node passed on has no document-URI property or it only contains one relative URI, the fn:document-uri() function returns the empty sequence.

Function definition:

XPath 1.0:

The function is not available.

XPath 2.0:

fn:document-uri($arg as node()?) as xs:anyURI?

   

 

 

 

back to top