Description
The fn:in-scope-prefixes function returns a sequence of prefixes (as strings) that are used in the in-scope namespaces for the $element element. The results include a zero-length string if there is a default namespace declaration. It also always includes the xml prefix, which is built into the XML recommendation.
Note that the function uses in-scope namespaces, as opposed to statically known namespaces. For example, it does not necessarily include all the prefixes declared in the prolog, if they are not used by $element or one of its ancestors. .
This description is © Copyright 2007, Priscilla Walmsley. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book. Arguments and Return TypeName | Type |
$element |
element() |
return value |
xs:string* |
Examples<xsl:variable name="in-xml" as="item()*"> | | <in-xml xmlns="http://datypic.com/prod"
xmlns:prod2="http://datypic.com/prod2">
xyz</in-xml> |
| </xsl:variable> |
XPath Example | Results |
---|
in-scope-prefixes($in-xml) |
('', 'prod2', 'xml') |
See AlsoHistory |
Recommended Reading:
|