Description
The functx:sort-document-order function sorts a sequence of nodes in document order. This can be done with a simple path expression, but the function is useful for making the purpose of the expression clear.
Arguments and Return TypeName | Type | Description |
$seq |
node()* |
the sequence to sort |
return value |
node()* |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:sort-document-order" as="node()*"
xmlns:functx="http://www.functx.com">
<xsl:param name="seq" as="node()*"/>
<xsl:sequence select="
$seq/.
"/>
</xsl:function>
|
Examples<xsl:variable name="in-xml" as="item()*"> | | <in-xml>
<a>123</a>
<b>456</b>
<c>789</c>
</in-xml> |
| </xsl:variable> |
XPath Example | Results |
---|
functx:sort-document-order(
($in-xml/c,$in-xml/a)) |
<a>123</a>
<c>789</c> |
See AlsoHistory |
Recommended Reading:
|