Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: reading from xml files

by GrandFather (Saint)
on Mar 26, 2007 at 22:17 UTC ( [id://606672]=note: print w/replies, xml ) Need Help??


in reply to reading from xml files

As others have pointed out your (not quite) XML data is not consistent with your code. The following sample may help:

use strict; use warnings; use XML::Twig; my $xml = <<XML; <root> <para>aaaaaaaaaaaaaaaaa dsnbbtejk</para> <para>aldmflskddddddddddddddddddffffffffffffff</para> </root> XML my $tmp = XML::Twig->new(); $tmp->parse ($xml); my $root = $tmp->root; print $_->trimmed_text (), "\n" for $root->children ('para');

Prints:

aaaaaaaaaaaaaaaaa dsnbbtejk aldmflskddddddddddddddddddffffffffffffff

DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

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

    No recent polls found