Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

Wwwwxxx reemine, WWWXXX.VCBA, WWWXXX.VCBA, TheboL.wwwxxxxx, WWWXXXAPC , wwwxxn.xsss, wwwxxxapc, WWWXXX.VCBA, wwwxxx vba, wwwxxxdoco

Links

XODOX
Impressum

#1: Need some help with XMLin

Posted on 2008-05-28 18:02:49 by Vasant Kumar

Hi,
I'm using PERL for the first time, and I need to parse an XML
Document.

Essentially we have a file that's structures like this

<A>
<B>
<C></C>
<C></C>
<C></C>
<C></C>
<C></C>
<C></C>
</B>
</A>

now when I do something like
$data = XMLin($XML, forcearray => ["C"]);

It has something similar to

$VAR1 = { B => { C => [ {1}, {2}. {3} ]}

Now accessing B is no problem, but I want to access the values in C..
do you know how this might be possible?

Thank you,
Vasant


--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Report this message

#2: Re: Need some help with XMLin

Posted on 2008-05-29 10:45:19 by peng.kyo

On Thu, May 29, 2008 at 12:02 AM, Vasant Kumar <vasantk@gmail.com> wrote:

>
> $VAR1 = { B => { C => [ {1}, {2}. {3} ]}
>
> Now accessing B is no problem, but I want to access the values in C..

Hello,

$VAR1->{B}->{C}->[0];
will get the first element of the anonymous array whose KEY is C.

--
Jeff Peng - Peng.Kyo@Gmail.com
Professional Squid supports in China
http://www.ChinaSquid.com/

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Report this message