home contribute faq download

FunctX XQuery Functions

fn:QName

Constructs a QName from a namespace and local part

Google
Webxqueryfunctions.com

Description

The fn:QName function takes a namespace URI and a qualified (optionally prefixed) name as arguments, and constructs a QName value from them. If $paramQName is prefixed, that prefix is retained in the resulting xs:QName value. Unlike the xs:QName constructor, the fn:QName function does not require a literal argument. Therefore, the name could be the result of a dynamically evaluated expression.

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

NameType
$paramURI xs:string?
$paramQName xs:string
return value xs:QName

Examples

XQuery ExampleResults
QName('http://datypic.com/prod','product')
A QName whose namespace is http://datypic.com/prod, whose prefix is empty, and whose local part is product
QName('http://datypic.com/prod',
  'pre:product')
A QName whose namespace is http://datypic.com/prod, whose prefix is pre, and whose local part is product
QName('', 'product')
A QName whose namespace is empty, whose prefix is empty, and whose local part is product
QName('', 'pre:product')
Error FOCA0002

See Also

fn:resolve-QNameResolves a QName based on the in-scope namespaces of an element
fn:local-name-from-QNameThe local part of a QName

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