LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to find the end tag in xml file. (https://www.linuxquestions.org/questions/linux-general-1/how-to-find-the-end-tag-in-xml-file-847413/)

mariakumar 11-30-2010 04:49 AM

how to find the end tag in xml file.
 
Hi,

I am newbie. I wanted to know how to find the end tag in shell where I have multiple tags in xml like

<tag name="x" version="1.0">
</tag>
<tag name="x" version="1.0">
</tag>
<tag name="x" version="1.0">
</tag>

And I wanted to update depends this xml as (in side the tag <subtag name="y"/>) depending upon the conditions like if 1,I have to update the first tag with the above mentioned tag and second and so on..

Thanks,
Maria Kumar

tshikose 12-21-2010 11:12 AM

Hi,

I would recommend you use Perl no shell.
Can you, if your XML lines above are the input, give clearly what you would like the output to be.
Then it should be easy to do it in Perl. Then fire the Perl from shell, as Perl is surely by default installed in all modern Linux boxes.

Regards,

Tshimanga.


All times are GMT -5. The time now is 02:41 PM.