I’m writing a small stand alone tool for Linux which needs read a huge xml-file.
The xml-file has simple structure and a progressive or streaming (line by line) parser is suitable for it.
I want to use a light-weight class library such as TinyXML but I don’t know it supports progressive parsing or not?!
If the answer is “yes”, Do you have a sample? And, if the answer is “no”, Do you know another alternative for it which is small and header only class library?
Update: How about RapidXML or pugiXML?
Sounds like libxml’s XmlReader interface is just what you want. Fast, simple, and streaming. Light-weight and XML don’t mix, unfortunately. I prefer XmlReader’s pull model to SAX’s push model, but they’ll both do what you want.
In the pull model, you call a function and get a new node, then check yourself if it matches. In the push model, you supply callbacks and SAX calls them as it finds nodes matching them.
TinyXML, last I checked, is not standards-compliant — I would avoid it.