I would like to write a command line script which combines multiple <author>
tags from an atom feed into one. For example, an entry like:
<entry>
<id>someid</id>
<published>somedate</published>
<title>Title</title>
<summary>Summary</summary>
<author>
<name>Author One</name>
</author>
<author>
<name>Author Two</name>
</author>
<author>
<name>Author Three</name>
</author>
</entry>
should become:
<entry>
<id>someid</id>
<published>somedate</published>
<title>Title</title>
<summary>Summary</summary>
<author>
<name>Author One, Author Two, Author Three</name>
</author>
</entry>
I think I could do it myself using Perl and regexes but, as parsing XML with regexes is not a good idea, I would be thankful for a more elegant solution that uses a proper xml-parser.