A
Andy Chambers
Hi,
I'd like to sort a nodelist using a sort key or just leave the
nodelist in document order if any of the nodes lack the specified sort
key. Is it possible to do this using just the select attribute on an
xsl:sort?
For example given the following input....
Example A:
<nodes>
<node rank="3">c</node>
<node rank="">a</node>
<node rank="2">b</node>
</nodes>
Example B:
<nodes>
<node rank="3">c</node>
<node rank="1">a</node>
<node rank="2">b</node>
</nodes>
For the input in Example A, I'd want to process the nodes in document
order. For the input in Example B, I'd want to process the nodes
according to their @rank attribute. What's the best way to acheive
this? Can it (or should it) be done without resorting to a xsl:choose
that checks whether all the @rank attributes have been set before
sorting?
Many Thanks,
Andy
I'd like to sort a nodelist using a sort key or just leave the
nodelist in document order if any of the nodes lack the specified sort
key. Is it possible to do this using just the select attribute on an
xsl:sort?
For example given the following input....
Example A:
<nodes>
<node rank="3">c</node>
<node rank="">a</node>
<node rank="2">b</node>
</nodes>
Example B:
<nodes>
<node rank="3">c</node>
<node rank="1">a</node>
<node rank="2">b</node>
</nodes>
For the input in Example A, I'd want to process the nodes in document
order. For the input in Example B, I'd want to process the nodes
according to their @rank attribute. What's the best way to acheive
this? Can it (or should it) be done without resorting to a xsl:choose
that checks whether all the @rank attributes have been set before
sorting?
Many Thanks,
Andy