XPath/XQuery QName function

Summary

Returns an xs:QName value formed using a supplied namespace URI and lexical QName.

Signature

fn:QName(
$paramURI as xs:string?,
$paramQName as xs:string
) as xs:QName

Properties

This function is deterministic, context-independent, and focus-independent.

Rules

The namespace URI in the returned QName is taken from $paramURI. If $paramURI is the zero-length string or the empty sequence, it represents "no namespace".

The prefix (or absence of a prefix) in $paramQName is retained in the returned xs:QName value.

The local name in the result is taken from the local part of $paramQName.

Examples

fn:QName("http://www.example.com/example", "person") returns an xs:QName with namespace URI = "http://www.example.com/example", local name = "person" and prefix = "".

fn:QName("http://www.example.com/example", "ht:person") returns an xs:QName with namespace URI = "http://www.example.com/example", local name = "person" and prefix = "ht".

Error Conditions

A dynamic error is raised if $paramQName does not have the correct lexical form for an instance of xs:QName.

A dynamic error is raised if $paramURI is the zero-length string or the empty sequence, and the value of $paramQName contains a colon (:).

A dynamic error may be raised if $paramURI is not a valid URI (XML Namespaces 1.0) or IRI (XML Namespaces 1.1).