in reply to XML::Simple--dealing with a variable element
@attrs = map { @{ $_->{attributes}{attribute} } } values %{ $data->{dataschemas}{dataschema} };
Update: actually, it doesn't look like your attribute nodes result in an array. Do you need the attribute names too, or just the values?
Maybe this will be clearer:
foreach my $dataschema ( values %{ $data->{dataschemas}{dataschema} } +) { while( my ($name, $value) = each %{ $dataschema->{attributes}{attr +ibute} } ) { # do something with the name and value } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML::Simple--dealing with a variable element
by bw (Novice) on Jul 26, 2006 at 22:57 UTC | |
by rhesa (Vicar) on Jul 26, 2006 at 23:01 UTC | |
by bw (Novice) on Jul 26, 2006 at 23:10 UTC | |
by rhesa (Vicar) on Jul 26, 2006 at 23:19 UTC | |
by bw (Novice) on Jul 26, 2006 at 23:33 UTC | |
|
Re^2: XML::Simple--dealing with a variable element
by bw (Novice) on Jul 27, 2006 at 17:13 UTC | |
by rhesa (Vicar) on Jul 27, 2006 at 18:14 UTC | |
by bw (Novice) on Jul 27, 2006 at 21:01 UTC | |
by rhesa (Vicar) on Jul 27, 2006 at 21:06 UTC |