xdmp:QName-from-key( $key as xs:string ) as xs:QName
Construct a QName from a string of the form "{namespaceURI}localname". This function is useful for constructing Clark notation parameters for the xdmp:xslt-eval and xdmp:xslt-invoke functions.
Parameters | |
---|---|
key | The string from which to construct a QName. |
(: Using a key based on a QName with an in-scope namespace prefix :) xquery version "1.0-ml"; let $key := xdmp:key-from-QName(xs:QName("xs:string")) let $qname := xdmp:QName-from-key($key) return ($key, $qname) (: Returns output of the following form: ( {http://www.w3.org/2001/XMLSchema}string, xs:string ) The generated QName uses the "xs" namespace prefix because this binding is implicitly defined in MarkLogic. :)
(: Using a key based on an arbitrary namespace :) xquery version "1.0-ml"; xdmp:QName-from-key("{/my/namespace}thing") (: Returns output of the following form: thing :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.