Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: XML Parse, Spanish Elements

by senik148 (Beadle)
on Feb 11, 2006 at 19:30 UTC ( [id://529592]=note: print w/replies, xml ) Need Help??


in reply to Re: XML Parse, Spanish Elements
in thread XML Parse, Spanish Elements

i will make sure i experiment with those other Modules.

For now i fixed everything!
i found the way.

#!/usr/bin/perl -w use strict; use warnings; use XML::Simple; use LWP::Simple; # get RSS data my $raw = get('http://www.fremontvirtualoffice.com/rmmame-dep.xml'); # create object my $xml = new XML::Simple; my $data = $xml->XMLin($raw); my @items = @{$data->{noticia}}; for my $hash ( @items ) { my $title = $hash->{titulo}; my $article = $hash->{texto}; my $date = $hash->{fecha}; my $time = $hash->{hora}; my $caption = $hash->{foto}->{pie}; my $photo_big = $hash->{foto}->{fotogrande}; my $photo_small = $hash->{foto}->{fotomedia}; print "TITLE: $title\n"; print "DATE: $date\n"; print "TIME: $time\n"; print "ARTICLE: $article\n"; print "PHOTO: $photo_big\n"; print "CAPTION: $caption\n"; }


I get all the Elements i need. Thank you all!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2024-04-24 11:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found