I have a xml file having following content.
<contracts>
<clients>
<client>
<name>Nicol</name>
<clientRef>123</clientRef>
</client>
<client>
<name>Basil</name>
<clientRef>8234</clientRef>
</client>
</clients>
<entries>
<entry>
<regCode>BCG</regCode>
<clientRef>63352</clientRef>
</entry>
<entry>
<regCode>TYD</regCode>
<clientRef>3242</clientRef>
</entry>
</entries>
</contracts>
The xml tags 'clientRef' are in both clients and entry sections. However, I need to remove the clientRef tags only in client section.
The desired output is :
<contracts>
<clients>
<client>
<name>Nicol</name>
</client>
<client>
<name>Basil</name>
</client>
</clients>
<entries>
<entry>
<regCode>BCG</regCode>
<clientRef>63352</clientRef>
</entry>
<entry>
<regCode>TYD</regCode>
<clientRef>3242</clientRef>
</entry>
</entries>
</contracts>
I am new to shell and sed commands. How I can remove the clientRef tags with shell scripts?