Loading TOC...

MarkLogic Server 11.0 Product Documentation
xdmp.keyFromQName

xdmp.keyFromQName(
   name as xs.QName
) as String

Summary

Construct a context-independent string from a QName. This string is of the form "{namespaceURI}localname" and is suitable for use as a map key.

Parameters
name The QName to compute a key for.

Example

// Using a QName with an in-scope namespace prefix
'use strict';
xdmp.keyFromQName('xs:string');

// Returns output of the following form:
//   {http://www.w3.org/2001/XMLSchema}string
//
// The generated key includes the XMLSchema namespace URI because the
// "xs" namespace binding is implicitly defined in MarkLogic.

Example

// Using a key based on an arbitrary namespace
'use strict';
xdmp.keyFromQName(fn.QName('/my/namespace', 'thing'));

// Returns output of the following form:
//   {/my/namespace}thing

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.