Imagine I have the folling XML file:
<a>before<b>middle</b>after</a>
I want to convert it into something like this:
<a>beforemiddleafter</a>
In other words I want to get all the child nodes of a certain node, and move them to the parent node in order. This is like doing this command: "mv ./directory/* .", but for xml nodes.
I'd like to do this in using unix command line tools. I've been trying with xmlstarlet, which is a powerful command line XML manipulator. I tried doing something like this, but it doesn't work
echo "<a>before<b>middle</b>after</a>" | xmlstarlet ed -m "//b/*" ".."
Update: XSLT templates are fine, since they can be called from the command line.
My goal here is 'remove the links from an XHTML page', in other words replace where the link was, with the contents of the link tag.