Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

XSLT Sorting Conditionally

$
0
0


Hi

I have the following xml


<TestRequests>

 <TestRequest CollectionStatus="Resulted">
  <Category>Hem</Category>
  <Text>Complete Blood Count</Text>
  <SortKey>A<SortKey/>
 </TestRequest>

 <TestRequest CollectionStatus="Resulted">
  <Category>CHem</Category>
  <Text>RBC Count</Text>
  <SortKey>B<SortKey/>
 </TestRequest>

</TestRequests>


I want to achieve sorting based on some conditions

In my case if any of the SortKey has value then the TestRequest should be sorted on SortKey ,
if all the sortkey elements are blank in that casethe sorting has to on say Category element

Could someone tell me how to solve this using XSLT


Regards
Gururaja.K.S


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>