iphony has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a piece of code that creates an XML as below:
I notice that the output ispush (@arr, {'Phones' => [ {'Manufacturer' => $unique_manufacturer_model_version[ +$i][9], 'Model' => $unique_manufacturer_model_version[$i][10], 'Version' => $unique_manufacturer_model_version[$i][11], 'Count' => $unique_manufacturer_model_version[$i][12] } +] } ); } my $xml = new XML::Simple(NoAttr=>1,RootName=>'terminalversioncount');
How can I get rid of the <anon>? I want them to be nested under <Phones> only, for each entry. Another question is, is it possible to append another set of different information (table) to the same XML output file? It seems that RootName can only be set once. Or does it means that I cannot use RootName as a delimiter for different tables? Thanks.<?xml version='1.0'?> <terminalversioncount> <anon> <Phones> <Count>2</Count> <Manufacturer>Sony</Manufacturer> <Model>SE1</Model> <Version>M94</Version> </Phones> </anon>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML::Simple - data storage/retrieval
by moritz (Cardinal) on Sep 05, 2008 at 10:18 UTC | |
Re: XML::Simple - data storage/retrieval
by themage (Friar) on Sep 05, 2008 at 10:23 UTC | |
Re: XML::Simple - data storage/retrieval
by Cody Pendant (Prior) on Sep 05, 2008 at 12:48 UTC | |
Re: XML::Simple - data storage/retrieval
by Anonymous Monk on Sep 05, 2008 at 10:43 UTC |
Back to
Seekers of Perl Wisdom