Hi,
I'm building a conforming and validating XML parser in C++ and trying to make it light-weight for use in pocket pc.
At the beginning I decided to add some "events" to my parser like SAX does, informing about elements, processing instructions, etc.
This events are taken by a derived class that builds the DOM tree of the xml.
My doubts appears when trying to handle mainly entities (which can contain elements, pi's and comments inside if defined) and their resolution.
For e.g., I can create a XMLEntityRef class that refers to some XMLEntity defined in some XMLDocType object like .NET system.xml parser does.
As I know, for most purposes an application needs to know an element, its contents, its respective attributes and their respective values... only strings... it doesn't care if the element content is formed by cdata objects, entity references and/or plain text... the same applies to attribute values.
So, my question is the following: What is the benefit of passing to an application each xml object as it appears and letting it (or a helper class) to build, for e.g., the resulting attribute's value by concatenating texts and resolved entity references?
If i'm making a poll, please answer: does your application need to know about cdata tags and where they are located in the xml file, or you make things easy... you want to know the full content value of an element in a string without worrying about how it is builded?
Best regards, Mauro H. Leggieri