I have this small xml file that is used in Mythtv - and, say, need to delete the entire button element with the type STREAM. Im using the XMLstarlet to insert elements, but I haven't found the command syntax to delete elements of a certain type.
<mythmenu name="LIBRARY">
<button>
<type>STREAM</type>
<text>Play Online Streams</text>
<text lang="HE">נגן מדיה מכוונת</text>
<action>PLUGIN mythstream</action>
<depends>mythstream</depends>
</button>
<button>
<type>IMAGES</type>
<text>Image Gallery</text>
<text lang="IT">Immagini</text>
<text lang="ES">Fotos</text>
<depends>mythgallery</depends>
</button>
</mythmenu>
to insert elements I insert them line-by-line, can this be done a more elegant way?
xml ed -O -i /mythmenu/button[1] -t elem -n button -v "" library.xml | \
xml ed -O -s /mythmenu/button[1] -t elem -n type -v "STREAM" | \
xml ed -O -s /mythmenu/button[1] -t elem -n text -v "Myth Vodka" | \
xml ed -O -s /mythmenu/button[1] -t elem -n action -v "PLUGIN mythvodka" | \
xml ed -O -s /mythmenu/button[1] -t elem -n depends -v "mythvodka"
thanks,
MBantz