in reply to Re^5: trying to understand xml::twig and also trying to learn how to extract attribute
in thread trying to understand xml::twig and also trying to learn how to extract attribute
OR can I just pick the element likeif ($one->first_child('traffic')->first_child('something')->fir +st_child('somethingelse')->first_child('getthis')->att('value') eq 'f +ound') { push @ids, $one->att('id'); push @ids, $one->true('yes'); }
Another words, is first_child definition the child of the root?(in this case , 'one' and then 'traffic' and then so on.. and therefore need to go down the chain in steps or can I say my parent is one and then first child is 'getthis' ?if ($one->first_child('getthis')->att('value') eq 'found') { push @ids, $one->att('id'); push @ids, $one->true('yes'); }
<one id="msn" type="shopping"> <traffic> <daily value="on" /> <weekly value="off" /> <something> <somethingelse> <getthis value="found" true="yes" /> <somethingelse> </something> <monthly value="off" /> </traffic> </one>
|
---|