Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XSL - conditional sort XSL - conditional sortTo: 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
