K
Krzysztof Poc
ello
I would like to operate on a "child" elements in following XML
document.
Note that "children" tag may not be present. I may access the specific
child
element as follows (I use XML::TreePP):
$tree->{singers}->{album}->[0]->{children}->{child}->[0]
My question is how can I do my task in a loop. I tried to combine both
"foreach" and "exists" functions but I failed.
Great thanks for help.
<singers>
<album>
<surname> John </surname>
<age> 25 </age>
<children>
<child> Alex </child>
<child> Ares </child>
</children>
<dog> small </dog>
</album>
<album>
<surname> Adam </surname>
<age> 33 </age>
<children>
<child> Anita </child>
<child> Marta </child>
</children>
<dog> medium </dog>
</album>
<album>
<surname> Lan </surname>
<age> 3 </age>
<dog> noDog </dog>
</album>
</singers>
I would like to operate on a "child" elements in following XML
document.
Note that "children" tag may not be present. I may access the specific
child
element as follows (I use XML::TreePP):
$tree->{singers}->{album}->[0]->{children}->{child}->[0]
My question is how can I do my task in a loop. I tried to combine both
"foreach" and "exists" functions but I failed.
Great thanks for help.
<singers>
<album>
<surname> John </surname>
<age> 25 </age>
<children>
<child> Alex </child>
<child> Ares </child>
</children>
<dog> small </dog>
</album>
<album>
<surname> Adam </surname>
<age> 33 </age>
<children>
<child> Anita </child>
<child> Marta </child>
</children>
<dog> medium </dog>
</album>
<album>
<surname> Lan </surname>
<age> 3 </age>
<dog> noDog </dog>
</album>
</singers>