Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <records>
  2. <car name='HSV Maloo' make='Holden' year='2006'>
  3. <country>Australia</country>
  4. <record type='speed'>Production Pickup Truck with speed of 271kph</record>
  5. </car>
  6. <car name='P50' make='Peel' year='1962'>
  7. <country>Isle of Man</country>
  8. <record type='size'>Smallest Street-Legal Car at 99cm wide and 59 kg in weight</record>
  9. </car>
  10. <car name='Royale' make='Bugatti' year='1931'>
  11. <country>France</country>
  12. <record type='price'>Most Valuable Car at $15 million</record>
  13. </car>
  14. </records>
  15.  
  16. def records= new XmlParser().parse(xmlFile)
  17.  
  18. println records.car.find {it.'@name' == 'HSV Maloo' && it.'@year' == '2006'}
  19.  
  20. println records.car.max { it.@'year'.toInteger() }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement