sananpah has asked for the wisdom of the Perl Monks concerning the following question:
I am a newbee to perl. I have written some simple programs but nothing very complex. I have a requirement where I have to write a complex program in Perl.
I have a XML file which looks like this :
I want to remove the element "dummy_record" from the file and again write the output as xml. So finally the file should look like this:<?xml version="1.0"> <escinfo> <dbf> <progress> <record> <title>11111</title> <id>abcd</id> </record> <record> <title>22222</title> <id>efgh</id> </record> <dummy_record> <dummy> <title>22222</title> <id>efgh</id> </dummy> </dummy_record> <dummy_record/> </progress> </dbf> </escinfo>
How can I do this using perl ?<?xml version="1.0"> <escinfo> <dbf> <progress> <record> <title>11111</title> <id>abcd</id> </record> <record> <title>22222</title> <id>efgh</id> </record> </progress> </dbf> </escinfo>
Thanks in advance.
Janitored by Arunbear - added code tags, as per Monastery guidelines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing XML file and removing the element
by borisz (Canon) on Apr 10, 2005 at 13:56 UTC | |
|
Re: Parsing XML file and removing the element
by Tanktalus (Canon) on Apr 11, 2005 at 03:38 UTC | |
|
Re: Parsing XML file and removing the element
by gsiems (Deacon) on Apr 14, 2005 at 18:20 UTC |