sort and group xml by attribute (date)



I have an xml file containing football results for a month but I need to group them together by date. What would be the best way to sort these out?



<match>
<date>Saturday 18th October 2014</date>
<game>1</date>
</match>
<match>
<date>Saturday 18th October 2014</date>
<game>2</date>
</match>
<match>
<date>Sunday 19th October 2014</date>
<game>3</date>
</match>
<match>
<date>Sunday 19th October 2014</date>
<game>4</date>
</match>
<match>
<date>Monday 20th October 2014</date>
<game>5</date>
</match>


So I could output them like:


Saturday 18th Game1 Game2


Sunday 19th Game3 Game4


Monday 20th Game5


Many thanks in advance


No comments:

Post a Comment