in reply to XML Parsing

If I have read the question correctly, order is important to you - ie, you need to preserve the order in which the tags are read.

According to the documentation I have read, you are right. XML::Simple will not do what you want but XML::Parser will. Further, it appears XML::Parser can be used in Table mode and will return an array much like what you appear to be asking for - saving you the pain of dealing with the Stream mode directly.

I found a good series of articles at Perl Month and, more to your problem, this article

Mik
Mik Firestone ( perlus bigotus maximus )

Replies are listed 'Best First'.
RE: Re: XML Parsing
by btrott (Parson) on Apr 12, 2000 at 21:55 UTC
    I think you mean Tree mode, not Table mode. (There's also an "Object" mode that returns a tree of Perl objects, named based on the element names.)

    The only bad thing about Tree mode is that the resultant data structure is rather difficult to understand, in my opinion. It's certainly not going to give you a nice hash to play around with. :) But if you feel like figuring out how the tree is structured, that may be your best option.

    There are some other modules that use tree representations: XML::Grove, XML::Twig, and XML::DOM. These are all discussed in that article I posted before.

      Dear Friends, I have an XML file that’s encoded in ISO-8859-1. I have some European characters coming in from 2 fields (Name, Comments) in the XML file. Can anyone suggest if there are any functions in Perl to read those characters? Using Perl can I parse this xml file? Please suggest. I have not done this before. Regards, Madhavi.