my $ref = $xs->XMLin($doc, ForceArray => [ 'incident' ]);
works if the 'id' attribute is removed from the Incident start tag. Changing the name to 'iid' also works.
Adding KeyAttr => [ ] to the options fixes this. From the doc for XML::Simple:
Note 1: The default value for 'KeyAttr' is ['name', 'key', 'id']. If you do not want folding on input or
unfolding on output you must setting this option to an
empty list to disable the feature.
Note 2: If you wish to use this option, you should
also enable the `ForceArray' option. Without
'ForceArray', a single nested element will be rolled
up into a scalar rather than an array and therefore
will not be folded (since only arrays get folded).
| [reply] [d/l] [select] |