in reply to XML Parsing Woes

If you're trying to build a data structure, then why not use XML::Parser in Tree mode (or XML::Simple). This will give you a data structure that models the XML document and your problem then becomes converting one Perl data structure into another.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^2: XML Parsing Woes
by Anonymous Monk on Aug 05, 2004 at 14:33 UTC
    I actually gave both of those recommendations a try and then quickly realized that the memory footprint would be far too high. The files I'm going to be parsing are on the order of 500MB.
      Then you probably want XML::Twig, which allows you to trigger on just a part of the tree as needed, while the parsing is happening.

      But I am confused. You say you want a data structure, yet when you've created such a data structure, you get more than you want. You'll need to decide exactly what you want!

      Or maybe you can build the data structure using DBM::Deep, which keeps most of it out on disk instead of in memory.

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.

        Randal, I used XML Twig and it did the job very nicely. Its fast and it didn't kill my memory. Thanks for pointing me at the module. Best