I'm trying to parse this xml input using the bash utility xpath
:
<?xml version="1.0" encoding="UTF-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<entry>
<title>Title 1</title>
<author>Author 1</author>
</entry>
<entry>
<title>Title 2</title>
<author>Author 2</author>
</entry>
</feed>
I need an output in this format:
1. Title: Title 1
Author: Author 1
2. Title: Title 2
Author: Author 2
I've fiddled around a lot trying to achieve this in a simple way (using only a single xpath
command, or at most 3-4 commands), but all my efforts have been in vain. Could anyone please help me out with this?