Boost logo

Boost Users :

From: Boris Kolpackov (boris_at_[hidden])
Date: 2006-03-30 03:04:47


Hi Delfin,

You may want to consider using C++ binding for XML, e.g.,

http://codesynthesis.com/products/xsd/

It can fulfil all of your requirements, see below.

"Delfin Rojas" <drojas_at_[hidden]> writes:

> I would like to know if it is possible to use the serialization lib and the
> XML archive to serialize into XML attributes instead of XML elements. For
> example I want to be able to generate something like:
>
> <song id="5" title="foo"/>

You can specify this in XML Schema.

> I would also like to know if the order of XML elements is strict. Meaning,
> if I have the XML:
>
> <song>
> <id>5</id>
> <name>foo</name>
> </song>
>
> Can I ask the library to de-serialize "name" and then "id"?

XML Schema allows you to specify whether ordering is important or not.

> What if the xml contains extra XML elements that I don't care to
> de-serialize? Will I get an error processing the archive?

With C++ binding for XML, you can disable validation and the resulting
code will ignore elements/attributes it does not know about.

hth,
-boris


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net