Description
The functx:siblings function returns the siblings of a node (but not the node itself). This does not include attributes, but does include elements, text nodes, processing instructions and comments.
Arguments and Return TypeName | Type | Description |
$node |
node()? |
the node |
return value |
node()* |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:siblings" as="node()*"
xmlns:functx="http://www.functx.com">
<xsl:param name="node" as="node()?"/>
<xsl:sequence select="
$node/../node() except $node
"/>
</xsl:function>
|
Examples<xsl:variable name="in-xml" as="item()*"> | | <authors a1='xyz'>
<author a2='abc'>
<fName a3='def'>Kate</fName>
<fName a3='def'>Jane</fName>
<lName>Jones</lName>
</author>
<author>
<fName a3='def'>John</fName>
<lName>Doe</lName>
</author>
</authors> |
| </xsl:variable> |
XPath Example | Results |
---|
functx:siblings(
$in-xml/author[1]) |
<author>
<fName a3="def">John</fName>
<lName>Doe</lName>
</author> |
functx:siblings(
$in-xml/author[1]/fName[2]) |
<fName a3="def">Kate</fName>
<lName>Jones</lName> |
See AlsoHistory |
Recommended Reading:
|