in reply to Programmatic access of hashes
If you are doing this as a learning exercise then you should take a look at the code used in some of the XML modules in CPAN. Note that many of the XML:: modules sit on top of one of a small number of parser modules, so bearing that in mind you might start by looking at something like XML::Parser.
The next next level up are modules like XML::TreeBuilder which maps fairly closely to what you have described so far. Beyond that are modules like XML::Twig which add ways of manipulating XML as it is being parsed thus reducing the need to store large parts of the file being processed in memory.
A common theme with these modules is that they are object oriented and tend to represent interesting parts of the XML document as objects. XML documents tend to have a highly recursive structure and using OO is one good way of dealing with that.
If, on the other hand you simply need a better way of dealing with XML than using XML::Simple (which is not), then you would save about ten years of your life by using XML::Twig or one of the other CPAN XML munging offerings.
|
|---|