in reply to Re: Parsing XML???
in thread Parsing XML???

Hello,
I probably should have stated this upfront, but the server this has to run on doesn't have XML::Simple, so I have to use XML::Parser. I'd love to just install XML::simple, but I don't have access to the perl library to add this mod, I can only use what they have. I've been looking at the perldoc for XML::Parser all day so far and trying things but can't get it to work. This should be something simple, but I can't figure out why it isn't working.

Thanks

Replies are listed 'Best First'.
Re: Re: Re: Parsing XML???
by dondelelcaro (Monk) on Nov 18, 2002 at 21:29 UTC
    Well, rather than reinventing the wheel, since XML::Simple is written totally in perl, you can just include it by adjusting your @INC to include it, rather than installing it into the normal search path.

    Failing that, you should be able to parse similarly to XML::Simple using XML::Parser's neat Tree style.
    use XML::Parser; $p1 = new XML::Parser(Style=> 'Tree'); my $xml = $p1->parsefile('foo.xml'); use Data::Dumper; print Dumper($xml);

    Granted, though, I haven't checked this code yet.. ;-)