[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Comparing element values
Hi Within the following structure I need to compare the value of two <price> elements and output the one with the highest value only. In the example below, the 3rd and 4th <price> elements are being compared. Any help would be greatly appreciated. -- Kevin PS: At a later date I would like to be able to compare a range of <price> elements. Better learn to walk first! --SNIPPET-- <property> <accommodation person="adult"> <holidays> <nights>7</nights> <price>269</price> <price>289</price> <price>309</price> <price>359</price> <price>319</price> <price>329</price> <price>299</price> </holidays> <holidays> <nights>14</nights> <price>304</price> <price>324</price> <price>344</price> <price>384</price> <price>364</price> <price>374</price> <price>-</price> </holidays> </accommodation> <accommodation person="child"> <holidays> <nights>7</nights> <price>269</price> <price>289</price> <price>409</price> <price>359</price> <price>319</price> <price>329</price> <price>299</price> </holidays> <holidays> <nights>14</nights> <price>304</price> <price>324</price> <price>344</price> <price>384</price> <price>364</price> <price>374</price> <price>-</price> </holidays> </accommodation> </property> --REQUIRED OUTPUT -- <property> <accommodation person="adult"> <holidays> <nights>7</nights> <price>269</price> <price>289</price> <price>359</price> <!-- 4th was the highest --> <price>319</price> <price>329</price> <price>299</price> </holidays> <holidays> <nights>14</nights> <price>304</price> <price>324</price> <price>384</price> <!-- 4th was the highest --> <price>364</price> <price>374</price> <price>-</price> </holidays> </accommodation> <accommodation person="child"> <holidays> <nights>7</nights> <price>269</price> <price>289</price> <price>409</price> <!-- 3rd was the highest --> <price>319</price> <price>329</price> <price>299</price> </holidays> <holidays> <nights>14</nights> <price>304</price> <price>324</price> <price>384</price> <!-- 4th was the highest --> <price>364</price> <price>374</price> <price>-</price> </holidays> </accommodation> </property>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|