当然,我只是在学习这样做,但我认为我让它变得比需要的更难
我们,好吧,我已经得到了这个 xml 文件。它只是由一堆事件数据组成,但是需要这些数据的组需要将数据反转。目前,它不首先显示最近的日期。
解析此文件,反转顺序然后将其吐回 xml 的最佳方法是什么?
任何帮助,将不胜感激。
下面的 xml 示例:我想对每个事件 [1-4] 的位置字段/节点重新排序/倒序
<rss version="2.0">
<channel>
<title>Thunder Dome - Calendar - Villiage Ctr</title>
<link>https://www.??????/?????.aspx</link>
<update>Wed, 15 June 2013 09:30 -0500</update>
<location>Thunder Dome - Upcoming Events</location>
<language>en-us</language>
<item>
<title>Event 1</title>
<link>https://www.??????/?????.aspx</link>
<pubDate>Wed, 15 June 2013 08:46 -0500</pubDate>
<location>June 29, 2013<br>, 8:00 AM, Town Square</location>
<guid>https://www.??????/?????.aspx</guid>
</item>
<item>
<title>Event 2</title>
<link>https://www.??????/?????.aspx</link>
<pubDate>Wed, 15 June 2013 08:43 -0500</pubDate>
<location>June 23, 2013<br>, 6:00 PM, Danny's Bar and Grill</location>
<guid>https://www.??????/?????.aspx</guid>
</item>
<item>
<title>Event 3</title>
<link>https://www.??????/?????.aspx</link>
<pubDate>Wed, 15 June 2013 08:43 -0500</pubDate>
<location>June 21, 2013<br>, 7:00 PM, Auditoriam</location>
<guid>https://www.??????/?????.aspx</guid>
</item>
<item>
<title>Event 4</title>
<link>https://www.??????/?????.aspx</link>
<pubDate>Wed, 15 June 2013 09:30 -0500</pubDate>
<location>June 20, 2013<br>, 6:30 PM, Grarage</location>
<guid>https://www.??????/?????.aspx</guid>
</item>
</channel>
</rss>