Re: Really simple XML question
- From: dermot@xxxxxxxxxxxxxxxx (Dermot Paikkos)
- Date: Fri, 31 Mar 2006 16:22:43 +0100
On 31 Mar 2006 at 9:39, Dave Adams wrote:
How do I print the value of 'Time Magazine'?
Here is my file (ejournlist.xml):
<?xml version='1.0'?>
<EJOURNLIST>
<EJOURN>
<TI>Africa Confidential</TI>
<ISSUE>Vol. 1, no.1</ISSUE>
<FILEFORMAT>PDFformat</FILEFORMAT>
</EJOURN>
<EJOURN>
<TI>Time Magazine</TI>
<ISSUE>Vol. 1, no.1</ISSUE>
<FILEFORMAT>TXTformat</FILEFORMAT>
</EJOURN>
</EJOURNLIST>
Here is my script:
#!/usr/bin/perl -w
use XML::Simple;
use Data::Dumper;
#create object
my $xml = new XML::Simple;
#read XML file
my $data = $xml->XMLin("ejournlist.xml");
#print output
print Dumper($data);
my $i = $data->{EJOURN}->[1]->{TI};
^ ^ ^
hasref array Idx Tagname
print "Val=$i\n";
Don't know what they call the other one :(
.
- References:
- Really simple XML question
- From: Dave Adams
- Really simple XML question
- Prev by Date: Re: Really simple XML question
- Next by Date: Re: the only difference is the 'x' after '/g'
- Previous by thread: Re: Really simple XML question
- Next by thread: sending email problem....
- Index(es):
Relevant Pages
|