If you use the available XML-Parser and XML-DOM modules, you can read the entire document into a memory structure. Once read, you can access any subdivision (node) in the XML document. That having been said/typed, I find myself wandering away from using those modules. They work as advertised, but, if you are reading big XML files, then they used large amounts of memory and can be quite slow.
If your XML structure is fairly simple and consistent, I would use a little regex stuff to parse the file and build a memory structure of just those elements that I really need. This avoids a lot of overhead the modules bring and uses a minumum of memory.
Conversely, if your XML is complex and inconsistent, then, buy some more memory and use the modules.
just my $.02 'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.