Reformating xml document
- by Joseph Reeves
I have an xml document in the format below:
<key>value</key>
<key>value</key>
<key>value</key>
But need to convert it to the following:
<tag k='key' v='value' />
<tag k='key' v='value' />
<tag k='key' v='value' />
The original xml file is roughly 20,000 lines long, so I'm keen to automate as much as possible! I've looked at xmlstarlet, but drew a blank with it. Presumably it would be a good place to start though? Help gratefully received, thanks.