我有一个 xml 文件完整的 facebook 消息,其中包含需要重新排列和关闭的元素。结构如下所示:
<john>
<timestamp>Tuesday, August 7, 2012 at 3:53pm EDT</timestamp>
<message>Cats or dogs?</message>
<hillary>
<timestamp>Sunday, August 8, 2012 at 1:54am EST</timestamp>
<message>Ugh, definitely dogs.</message>
<john>
and<hillary>
标签需要关闭,and<timestamp>
元素<message>
需要交换:
<john>
<message>Cats or dogs?</message>
<timestamp>Tuesday, August 7, 2012 at 3:53pm EDT</timestamp>
</john>
<hillary>
<message>Ugh, definitely dogs.</message>
<timestamp>Sunday, August 8, 2012 at 1:54am EST</timestamp>
</hillary>
我是正则表达式的新手,对此我感到很难过。任何帮助将不胜感激!