xdmp.QNameFromKey( key as 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 'use strict'; const key = xdmp.keyFromQName('xs:string'); const qname = xdmp.QNameFromKey(key); [key, qname]; // Returns output of the following form: // ["{http://www.w3.org/2001/XMLSchema}string", "xs:string"] // // The generated key uses the "xs" namespace prefix because // this binding is implicitly defined in MarkLogic.
// Using a key based on an arbitrary namespace 'use strict'; xdmp.QNameFromKey('{/my/namespace}thing'); // Returns output of the following form: // thing