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.
In reply to Re: XML data reading/output
by toolic
in thread XML data reading/output
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |