in reply to XML data reading/output

XML::Twig can help you:
use strict; use warnings; use XML::Twig; my $xfile = shift; my $t = new XML::Twig( twig_handlers => {descriptors => \&desc} ); $t->parsefile($xfile); sub desc { my ($twig, $desc) = @_; if ($desc->att('type') eq 'CTC') { $desc->first_child('descriptor')->first_child('mainterm')->pri +nt(); } }

Please post valid XML.

Replies are listed 'Best First'.
Re^2: XML data reading/output
by Anonymous Monk on Sep 04, 2009 at 22:36 UTC

    Thanks so much for the help.<\p>
    My xml file is too big to run. It has out of memory error now. My file size is about 1G.
    Please help.