XML::Parser tree/object parse results usage.

K

kf

Hi,

I'm parsing some relatively complex XML files, but actually only need
to access a couple of the bits of information stored with them.

I thought about coding some kind of parser myself, but am fighting the
urge to persevere with the XML::parser module.

So. I use XML::parser in "Tree" mode to create a big array of arrays of
arrays and then figured I could pass a reference to this array to
something like this:

sub FindObjByName
{
my $name = shift;
my $ref = shift;

if ($ref->[0] eq $name)
{
return $ref->[1];
}
else
{
if ($ref->[0][1])
{
&FindObjByName($name, $ref->[0][1]);
}
else
{
return 0;
}
}
}

But I'm having endless issues getting it to work.

Any help greatly appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top