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* |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:distinct-element-paths" as="xs:string*"
xmlns:functx="http://www.functx.com">
<xsl:param name="nodes" as="node()*"/>
<xsl:sequence select="
distinct-values(functx:path-to-node($nodes/descendant-or-self::*))
"/>
</xsl:function>
|
Examples<xsl:variable name="in-xml" as="item()*"> | | <authors>
<author>
<fName>Kate</fName>
<lName>Jones</lName>
</author>
<author>
<fName>John</fName>
<lName>Doe</lName>
</author>
</authors> |
| </xsl:variable> |
XPath 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:
|