Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

c++ xml parser



On Fri, Apr 22, 2011 at 12:23 PM, Mark Woodward <markw-FJ05HQ0HCKaWd6l5hS35sQ at public.gmane.org>wrote:

> There are lots of XML parsers, i.e. systems like expat work fine, that
> answers problem #1. The next problem is how do you represent the data in
> C++? How generic does it need to be? what attribute takes will you
> recognize? will a <tag value='abcedf'/> be sufficient? Or does it need
> to be <tag>abcdef</tag>? Can it be both? Where's your data type
> represented, in the tag or a type attribute?
>

The purpose of an XML parser/serializer is to help you transfer data between
an external XML document and your program's domain object model. So the
problem your describing is only a problem within the relatively narrow scope
of the code that does the marshalling and unmarshalling. It's not a great
idea to use the XML parser's objects (e.g. Node, Entity, Attribute, etc.) to
represent the data within your business logic because that couples your code
to the parser's API and the XML document format in a very pervasive way.





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org