Loading TOC...

MarkLogic 10 Product Documentation
fn.prefixFromQName

fn.prefixFromQName(
   arg as xs.QName?
) as xs.NCName?

Summary

Returns an xs:NCName representing the prefix of $arg. The empty sequence is returned if $arg is the empty sequence or if the value of $arg contains no prefix.

Parameters
arg A qualified name.

Example

fn.prefixFromQName(
   fn.QName("http://www.example.com/example", "person") )

=> empty sequence, because the QName constructed
   by fn.QName does not have a prefix

Example

const foo = xdmp.unquote('<foo xml:lang="en"/>');
const node = fn.head(foo).xpath("./foo/@xml:lang");
fn.prefixFromQName(fn.nodeName(node));

=> xml

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