in reply to XML::Simple - Make arrays out of class attribute

you can somewhat get near that hashstructure you want with
my $xmldata = XMLin($filename, KeyAttr => [ ]);
that produces something like:
$VAR1 = { 'div' => [ { 'content' => 'data1', 'class' => 'A' }, { 'content' => 'data2', 'class' => 'A' }, { 'content' => 'data1', 'class' => 'B' }, { 'content' => 'data2', 'class' => 'B' } ] };
which you can easily transform to the datastructure of your preference

Replies are listed 'Best First'.
Re^2: XML::Simple - Make arrays out of class attribute
by mscharrer (Hermit) on Sep 15, 2008 at 15:58 UTC
    Thanks mtths,
    that's a good start. Might be the farest I can get with XML::Simple options. I think this makes the needed transformation easier.
      Easier how? KeyAttr => [] is just the defaultjust like the default in this case. This is exactly the input on which my transformation code works.
        as per XML::Simple documentation:
        Note 1: The default value for 'KeyAttr' is ['name', 'key', 'id'].