in reply to Add new elements with XML::Simple
I'm intrigued by what you expect keyattr => 1 to do.
Setting KeyAttr to a scalar like this ...
my $opt = XMLin($xml, KeyAttr => 'kool', forcearray => [ 'trans' ]);... probably ought to throw an exception, but in fact it's an undocumented way to do this ...
my $opt = XMLin($xml, KeyAttr => [ 'kool' ], forcearray => [ 'trans' ]);... but setting it to '1' makes no sense at all since '1' is not a valid name for an XML attribute. Perhaps what you want to do is turn array folding off altogether, in which case you should set KeyAttr to an empty list:
my $opt = XMLin($xml, KeyAttr => [ ], forcearray => [ 'trans' ]);
|
|---|