Description
The fn:local-name function is useful only for element, attribute and processing instruction nodes. For an element or attribute, this is simply its name, stripped of any prefix it might have.
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 |
$arg |
node()? |
return value |
xs:string |
Examplesdeclare namespace pre = "http://datypic.com/pre";
declare namespace unpre = "http://datypic.com/unpre"; | let $in-xml := | <noNamespace>
<pre:prefixed xmlns="http://datypic.com/unpre"
xmlns:pre="http://datypic.com/pre">
<unprefixed pre:prefAttr="a" noNSAttr="b">123</unprefixed>
</pre:prefixed>
</noNamespace>
| return |
XQuery Example | Results |
---|
local-name($in-xml) |
noNamespace |
local-name($in-xml//pre:prefixed) |
prefixed |
local-name($in-xml//unpre:unprefixed) |
unprefixed |
local-name($in-xml//@pre:prefAttr) |
prefAttr |
local-name($in-xml//@noNSAttr) |
noNSAttr |
See AlsoHistory |
Recommended Reading:
|