B
-Brad-
Hi all,
I have an xml file that looks like :
<control_file name="XXXX_99.ctl">
<files_ps count="2">
<file seq="1" name="file1.gz" size="1107045" />
<file seq="2" name="file2.gz" size="1107045" />
</files_ps>
</control_file>
I would like to be able to loop through all the child elements under
files_ps, and print out their attribute values.
I was planning on using forcearray on the 'file' node so I can loop through
all the array elements, but I cant seem to get it to work.
use Data:
umper;
use XML::Simple;
my $xs = new XML::Simple();
my $xml = $xs->XMLin(<->,
keeproot => '1',
forcearray=> ['file',]
);
print Dumper($xml); # it still looks like a hash, not an array!
Any help would be apprecitaed!
Cheers
I have an xml file that looks like :
<control_file name="XXXX_99.ctl">
<files_ps count="2">
<file seq="1" name="file1.gz" size="1107045" />
<file seq="2" name="file2.gz" size="1107045" />
</files_ps>
</control_file>
I would like to be able to loop through all the child elements under
files_ps, and print out their attribute values.
I was planning on using forcearray on the 'file' node so I can loop through
all the array elements, but I cant seem to get it to work.
use Data:
use XML::Simple;
my $xs = new XML::Simple();
my $xml = $xs->XMLin(<->,
keeproot => '1',
forcearray=> ['file',]
);
print Dumper($xml); # it still looks like a hash, not an array!
Any help would be apprecitaed!
Cheers