Making XML unique using shell script

ultimate5ivez

New Member
I have a XML which has repeating tags. I need to change the XML with unique tags. One way is to append a number after each repeating tags.Consider the following XML\[code\]<serviceAddressing><name>google</name><serviceState><state>REQUESTING</state><serviceaddress>Downtown</serviceaddress><name>Thomson</name></serviceState><serviceState><state>REQUESTING</state><serviceaddress>California</serviceaddress><name>Amanda</name></serviceState><serviceState><replyTo><address>London</address></replyTo></serviceState>\[/code\]I want to make the repeating tags unique.Somehthing like,\[code\]<serviceAddressing><name>google</name><serviceState1><state1>REQUESTING</state1><serviceaddress1>Downtown</serviceaddress1><name1>Thomson</name1></serviceState1><serviceState2><state2>REQUESTING</state2><serviceaddress2>California</serviceaddress2><name2>Amanda</name2></serviceState2><serviceState3><replyTo><address>London</address></replyTo></serviceState3></serviceAddressing>\[/code\]
 
Back
Top