Loading TOC...

MarkLogic Server 11.0 Product Documentation
fn:in-scope-prefixes

fn:in-scope-prefixes(
   $element as element()
) as xs:string*

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

xquery version "1.0-ml";
declare namespace a="a";
declare namespace b="b";

let $x := <a:hello>hello
            <b:goodbye>goodbye</b:goodbye>
	  </a:hello>
return
fn:in-scope-prefixes($x)

=> ("a", "xml")

xquery version "1.0-ml";
declare namespace a="a";
declare namespace b="b";

let $x := <a:hello>hello
            <b:goodbye>goodbye</b:goodbye>
	  </a:hello>
return
fn:in-scope-prefixes($x/b:goodbye)

=> ("b", "a", "xml")

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