fn:QName

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.

Error Conditions

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

A dynamic error is raised [ERRFOCA0002] 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 [ERRFOCA0002] if $paramURI is not a valid URI (XML Namespaces 1.0) or IRI (XML Namespaces 1.1).

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".