home contribute faq download

FunctX XQuery Functions

fn:document-uri

The URI of a document

Google
Webdatypic.com

Description

The fn:document-uri function is basically the inverse of the fn:doc function. Where the fn:doc function accepts a URI and returns a document node, the fn:document-uri function accepts a document node and returns the absolute URI associated with it. The URI may represent the location from which it was retrieved, or simply the URI that serves as its name in an XML database.

In most cases, calling this function has the same result as calling the fn:base-uri function with the document node.

This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book.

Arguments and Return Type

NameTypeDescription
$arg node()? the node for which you want the document URI
return value xs:anyURI?

Examples

XQuery ExampleResults
document-uri(doc(
   'https://www.datypic.com/functx./input/order.xml'))
http://www.functx.com/input/order.xml

See Also

fn:docOpens a document based on a URI
fn:base-uriThe base URI of a node

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26W3C, XQuery 1.0 and XPath 2.0 Functions and Operators, http://www.w3.org/TR/xpath-functions/
Datypic XQuery Services

Recommended Reading:

XQuery