Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: XML data reading/output

by toolic (Bishop)
on Sep 04, 2009 at 19:16 UTC ( [id://793566]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://793566]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-24 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found