how to edit a xml file
Hi, i am new comer in linux script
i have a xml and i want to search a text and this text is find in which tag i want to copy this tag and paste in below it. and remove it child tag. how can i do?
before searching and editing ::
example
<root>
<emp name="abc">
<company addr="xyz"></company>
<company name="zxc"></company>
</emp>
<emp name="jkl">
<company addr="123"></company>
<company name="qwe"></company>
</emp>
</root>
i want to search a string company addr "xyz" and copy it tag <emp> and paste it below and remove all it child tag Like:-
<root>
<emp name="abc">
<company addr="xyz"></company>
<company name="zxc"></company>
</emp>
<emp name="abc">
</emp>
<emp name="jkl">
<company addr="123"></company>
<company name="qwe"></company>
</emp>
</root>
please help me how can i do this
|