
On Tue, Nov 08, 2005 at 12:09:03AM +0100, Andreas Pokorny wrote:
On Mon, Nov 07, 2005 at 09:46:24AM -0800, Robert Ramey <ramey@rrsd.com> wrote:
but I would like to see at least these different APIs: * on-demand parsing, a parser drived by a cursor, that allows to navigate through a document, without loading it completly (I dont see a need for prior validation, here)
The serialization library does exactly this with the spirit xml parser. ...
I always assumed that spirit has full control over the parsing process, so the parse() function itself is the driving force to walk towards the end of input. The above really was about jumping through the file (provided that the file is well formed xml) and only examining the chunks around the interesting data fields. Maybe I am a bit to optimistic about parsing xml files :).
* direct mapper of c++ structures to a certain format, so a kind of xml serialization,
I'm not sure how this differs from the xml serialization already in the serialization library.
The boost::serialization archives tries to encode C++ objects in data streams, that might be xml documents as well. So the archive defines the format, and adds suficient meta information to be able to recreate the objects with the aid of the meta data found in the serialize-functions.
I was talking about a use case in which a certain known XML format has to be mapped onto C++ structures. Thus the C++ structures already got designed to represent the model which is discribed by that certain XML format. Still the binding between the format ought to be separate.
Another case is where you have an existing XML vocabulary and you want to create a C++ representation of it for data manipulation. There are a lot of tools that allow you to generate class hierarchies from XML schema or similar, for example xsd (http://codesynthesis.com/products/xsd/). I don't really think Boost library should stray into this area, but it should probably be considered as a use case for an XML API. cheers, Graham -- Graham Bennett