in reply to Re^2: XML Parsing
in thread XML Parsing
Quite simply $hash_when_cat_eq_special is a pointer to a hash. So you can do your normal hash operations on it. The ->pointer() function returns this for you.
In terms of the foreach:
foreach my $elem ( @{ $xml_obj->{list}{value} } ) { $hash_of_subtree = $elem->pointer() ; }
The advantage here is that $xml_obj, $xml_obj->{list} ... are all Objects of type XML::Smart and can always be used as either a hash OR an array.
To extract your data you can simply use the 'pointer' function ( $xml_smart_obj->pointer() )that will return the hash structure or the 'content' function ( $xml_smart_obj->content() ) that will return the contents of a node.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: XML Parsing
by vmallya (Initiate) on Feb 08, 2013 at 14:14 UTC | |
by tmharish (Friar) on Feb 08, 2013 at 14:25 UTC | |
by vmallya (Initiate) on Feb 11, 2013 at 10:08 UTC | |
by tmharish (Friar) on Feb 12, 2013 at 14:03 UTC | |
by vmallya (Initiate) on Feb 13, 2013 at 07:10 UTC |
In Section
Seekers of Perl Wisdom