in reply to XML::XPath tricks and tips
What you can do is to use some module that loads XML into a HASH tree, and access the values directly from the tree. You can take a look at XML::Simple (more popular) and XML::Smart (well, I'm the author of it, so I shouldn't say what is better).
Well, the main idea of XML::Smart is to enable the use of XML by programmers without need to really know the XML format. Here's a simple example of how to do what you want:
use XML::Smart ; my $xml = new XML::Smart('available_batchnyyn.xml'); my @avaliables = @{ $xml->{AvailableBatch}{Available} } ; foreach my $avaliables_i ( @avaliables ) { my $part = $avaliables_i->{Part} ; my $qty = $avaliables_i->{Qty} ; print "Part: $part ; Qty: $qty\n" ; }
Graciliano M. P.
"Creativity is the expression of the liberty".
|
|---|