Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

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

by convenientstore (Pilgrim)
on Nov 16, 2008 at 04:44 UTC ( [id://723883]=note: print w/replies, xml ) Need Help??


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

actually i did make it work
my $sabal = new XML::Twig( twig_roots => { 'foo/yahoo' => #'bayking[@id="kingtony"]' => sub { my ($yabal, $element ) = @_; if ( $element->first_child('bayking_li +st')->first_child('bayking')->att('id') eq 'kingtony' ) { $element->print; } } } ); $sabal->parse($xml);
result-->
<yahoo V="baz"><bay_id><value>1000</value><fact>yes</fact></bay_id><ba +y_seen><value>50</value><fact>no</fact></bay_seen><bay_overall value= +"disabled"/><bayking_list><bayking active="true" country="Russia" id= +"kingtony"><bayking type="dictator"/><bay_usage value="none"/><baykin +g_origin><bayking_origin_name emmigrate="no" value="ohio_usa"><econom +y_status_previous value="very poor"/></bayking_origin_name></bayking_ +origin></bayking></bayking_list><bayqueen_list><bayqueen active="true +" country="japan" id="queensarah"><bayqueen type="dictator"/><bay_usa +ge value="none"/><bayqueen_origin><bayqueen_origin_name emmigrate="no +" value="ca_usa"/><economy_status_previous value="very poor"/><previo +us marriage="no"/></bayqueen_origin></bayqueen></bayqueen_list></yaho +o>
now I just need to work on putting this on hash of hash refernce...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found