in reply to XML data reading/output
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 |