Description
The functx:distinct-element-paths function returns a sequence of strings representing the paths of elements that are in $nodes or among their descendants.
Arguments and Return TypeName | Type | Description |
$nodes |
node()* |
the root(s) to start from |
return value |
xs:string* |
XQuery Function DeclarationSee XSLT definition. | declare namespace functx = "http://www.functx.com";
declare function functx:distinct-element-paths
( $nodes as node()* ) as xs:string* {
distinct-values(functx:path-to-node($nodes/descendant-or-self::*))
} ; |
Exampleslet $in-xml := | <authors>
<author>
<fName>Kate</fName>
<lName>Jones</lName>
</author>
<author>
<fName>John</fName>
<lName>Doe</lName>
</author>
</authors> | return |
XQuery Example | Results |
---|
functx:distinct-element-paths(
$in-xml) |
('authors',
'authors/author',
'authors/author/fName',
'authors/author/lName') |
functx:distinct-element-paths(
$in-xml/author[1]) |
('authors/author',
'authors/author/fName',
'authors/author/lName') |
Depends OnSee AlsoHistory |
Recommended Reading:
|