I have an XSL variable matchedNodes
which holds XML data. Which means
<xsl:copy-of select="$matchedNodes"/>
will produce an XML like this
<home name="f">
<standardpage>
<id text="a1"></id>
</standardpage>
<searfchpage>
<id text="a2"></id>
</searfchpage>
<searfchpage>
<id text="a3"></id>
</searfchpage>
</home>
I want to sort this XML so that searfchpage
nodes always comes first..Is there any way to do this?
Simple ordering (move
<searfchpage>
to the top, keep the rest of the children in orignal order):complex ordering (lets you define any arbitrary order, either dynamically via a param or statically via a hard-coded string):
Try this,
Input:
XSL:
Output