Loading TOC...

fn.inScopePrefixes

fn.inScopePrefixes(
   $element as Node
) as ValueIterator

Summary

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.

Example

var 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")

var 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")

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy