I am trying to get an reference of a XML formatted data using XML::Simple::XMLin
and again trying to retrive the XML data as it was before using XML::Simple::XMLout.
But finding a deviation in the format can any pls help me out.
Input file sr.xml
===========
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="ISO-8859-1" ?>
- <scenario>
- <counter>
- <counterdef name="HbH-counter" init="1000"> </counterdef>
- <counterdef name="EtE-counter" init="2000"> </counterdef>
- <counterdef name="session-counter" init="10005"> </counterdef>
- </counter>
- </scenario>
=======
Expand|Select|Wrap|Line Numbers
- my $data='';
- $file_to_parse='sr.xml';
- my $xml = new XML::Simple;
- my $config = eval { XML::Simple::XMLin("$file_to_parse") };
- $data = $xml->XML::Simple::XMLin("$file_to_parse",keeproot => 1);
- print $xml->XMLout($data,outputfile =>'/var/tmp/Call',keeproot => 1);
==================
Expand|Select|Wrap|Line Numbers
- <scenario>
- <counter name="counterdef">
- <EtE-counter init="2000" />
- <HbH-counter init="1000" />
- <session-counter init="10005" />
- </counter>
- </scenario>
My expectation was as it was before :
Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" encoding="ISO-8859-1" ?>
- <scenario>
- <counter>
- <counterdef name="HbH-counter" init="1000"> </counterdef>
- <counterdef name="EtE-counter" init="2000"> </counterdef>
- <counterdef name="session-counter" init="10005"> </counterdef>
- </counter>
- </scenario>