Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^8: xml::twig gathering all element and att and its value question

by convenientstore (Pilgrim)
on Nov 13, 2008 at 06:13 UTC ( [id://723350]=note: print w/replies, xml ) Need Help??


in reply to Re^7: xml::twig gathering all element and att and its value question
in thread xml::twig gathering all element and att and its value question

yes definitely understand
I am trying below so that I can find all element/att/value .. so far no luck but will keep digging
my $yahoo = 'one'; my @ones; my $twig = XML::Twig->new ( twig_roots => { computer => sub { oneHandl +er ( \@ones, @_, $yahoo);} } ); $twig->parse($xml); print Dumper(@ones); sub oneHandler { my ($result_ref, $twig, $elt,$yabal ) = @_; my %master; return unless $elt->att('id') eq $yabal; for my $child ( $elt->descendants() ) { #my %atts = %{ $child->atts () }; $master{$child->child} = %{ $child->atts () }; next unless %master; push @$result_ref, \%master; } }
  • Comment on Re^8: xml::twig gathering all element and att and its value question
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://723350]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-26 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found