Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSL - conditional sort

From: Andy Chambers <achambers.home@----------.--->
To: NULL
Date: 1/12/2009 9:30:00 AM
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



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent