Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: What is the best way to create C++ objects from parsed XML data?

From: the_edge123.nospam@-------------.-- (------ -)
To: NULL
Date: 8/5/2004 12:08:00 AM
Jim Williams <not.me@n...> wrote in message news:<qom0h0lfa5t064ufqnb8t206lhmmk49187@4...>...
> **** Post for FREE via your newsreader at post.usenet.com ****
> 
> I'm working on a 3d engine system.
> I need to save/load data in the systems objects to/from XML files.
> When I say objects, I mean C++ objects. (These generally correspond to
> scene objects, but that consideration isn't important as far as
> loading/saving goes.)
> 
> I think I have a reasonable grasp of XML, it's method of data
> representation, and parsing XML files. 
> (At the moment I'm looking at using the expat XML parser for it's
> callback based system, so I don't have to load/parse the whole -
> potentially v large - XML file into memory before I create objects).
> 
> The problem I'm having is deciding how to get the data from the XML
> parser into the C++ objects. 
> How is this normally done?
> Do you pass the completed/parsed XML node to the C++ object creator?
> Do you create the object object and set it's members with data from
> the completed/parsed XML node?
It depends on the message size. If it is too big, parse using the SAX
method, otherwise, you may use DOM.
> 
> What's the best/most flexible way to do this, or are what are pros and
> cons of various methods?
> Pointers to some examples would be greatly appreciated.
http://xml.apache.org
> 
> Thanks
> 
> Jim Williams
> 
You're welcome,
Fabien


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent