0

I'm looking for an XML library that writes out the XML stream as it goes. I've looked at TinyXML, pugixml, etc. and it seems these only write the stream when the entire DOM is built in memory. I want a library that will write each object as soon as all children and attributes are available. Is there such a thing?

paperjam
  • 8,321
  • 12
  • 53
  • 79

2 Answers2

2

The word you're looking for is SAX.

Xerces is one such C++ SAX library. If you're in the MS world then MSXML supports SAX2 too.

GazTheDestroyer
  • 20,722
  • 9
  • 70
  • 103
  • Now I know the correct term, I've found a very similar question: http://stackoverflow.com/questions/1693523/stax-writer-implementation-for-c-c – paperjam Feb 07 '12 at 13:28
1

I wrote my own library in the end. I'm willing to share the source if it's of interest to anyone - it's a little clunky and minimal though.

paperjam
  • 8,321
  • 12
  • 53
  • 79