![]() |
|
No such thing as a small change | |
PerlMonks |
How to get paired values from the nested XML structure?by vagabonding electron (Chaplain) |
on Nov 01, 2011 at 14:45 UTC ( #935133=perlquestion: print w/replies, xml ) | Need Help?? |
vagabonding electron has asked for the
wisdom of the Perl Monks concerning the following question:
Dear Monks, please help me on the following issue: given is the following xml-file (in fact this is an excerpt from the huge file but it shows the problem, imho): I need (among other things) to get the list of paired values "art_code" and "quantity" per unit - e.g. in the following form: Since I am a novice in Perl I could only make the following crook so far, the output could be after all proceeded with a regex (flush). I have an additional problem here too. As you see some positions have exact numbers at <quantity> and some others have a tag <quantity_small/>. I would like to get only the positions where there are exact numbers. I tried to modify the above script in the following way: but it seems to have no effect on the output. How could I get the paired values in a better way and filter the inexact quantity informations out? Thank you in advance for your help! VE
Back to
Seekers of Perl Wisdom
|
|