fn.inScopePrefixes( element as Node ) as Sequence
Returns the prefixes of the in-scope namespaces for $element. For namespaces that have a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has no prefix, it returns the zero-length string.
Parameters | |
---|---|
element | The element whose in-scope prefixes will be returned. |
const x = xdmp.unquote('<a:hello xmlns:a="a">hello' + '<b:goodbye xmlns:b="b">goodbye</b:goodbye>' + '</a:hello>'); fn.inScopePrefixes(fn.head(x).xpath("/element()")); => ("a", "xml") const x = xdmp.unquote('<a:hello xmlns:a="a">hello' + '<b:goodbye xmlns:b="b">goodbye</b:goodbye>' + '</a:hello>'); fn.inScopePrefixes(fn.head(x).xpath("/element()/element()")); => ("b", "a", "xml")
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.