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

How to create xsl for best available with best rate?

$
0
0

 This is the xml

<Products><Product><ProductCode>1001</ProductCode><AvailabilityStatus>Available</AvailabilityStatus><TotalPrice>15.000</TotalPrice></Product><Product><ProductCode>1001</ProductCode><AvailabilityStatus>ON-Request</AvailabilityStatus><TotalPrice>10.000</TotalPrice></Product><Product><ProductCode>1002</ProductCode><AvailabilityStatus>ON-Request</AvailabilityStatus><TotalPrice>15.000</TotalPrice></Product><Product><ProductCode>1002</ProductCode><AvailabilityStatus>ON-Request</AvailabilityStatus><TotalPrice>10.000</TotalPrice></Product><Product><ProductCode>1003</ProductCode><AvailabilityStatus>Available</AvailabilityStatus><TotalPrice>15.000</TotalPrice></Product><Product><ProductCode>1003</ProductCode><AvailabilityStatus>Available</AvailabilityStatus><TotalPrice>10.000</TotalPrice></Product></Products>

I need out put like below

<Products><Product><ProductCode>1001</ProductCode><AvailabilityStatus>Available</AvailabilityStatus><TotalPrice>15.000</TotalPrice></Product><Product><ProductCode>1002</ProductCode><AvailabilityStatus>ON-Request</AvailabilityStatus><TotalPrice>10.000</TotalPrice></Product><Product><ProductCode>1003</ProductCode><AvailabilityStatus>Available</AvailabilityStatus><TotalPrice>10.000</TotalPrice></Product></Products>

1. Take only cheap price

2. If product <AvailabilityStatus> is 'Available', take only Available otherwise On-Request

How i write this in xsl 1.0






Viewing all articles
Browse latest Browse all 935

Trending Articles



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