Boost logo

Boost Users :

From: Jabe (tahoma_at_[hidden])
Date: 2006-06-22 12:05:44


hello,

i try to create a xml archive that fit our needs. the default xml
serializer
handles not the format i would like to implement.
some differences are:
  - primitive types (int, float, ...) should be written as xml attributes
  - array types should not provide any parent xml element, all array
elements
    will be serialized as childs from the element containing the array
  - tagnames should always contain the classname
  - parent classes should create a new xml child element
  - and some more, but so far

as an example the default xml code looks like this:
<foo class_name="Class1" class_id="1">
   <name>example</name>
   <container class_id="2">
     <count>2</count>
     <item class_id_reference="2">
       <a>123</a>
     </item>
     <item class_id_reference="3" class_name="Class3">
       <b>456</b>
     </item>
</foo>

i would like this output:
<Class1 role="foo" name="example">
   <Class2 role="container" a="123" />
   <Class3 role="container" b="456" />
</Class1>

is that possible with the current boost::serialization and boost::archive
libraries?
i tried to derive all baseclasses of xml_oarchive and reimplemented it,
without
success.

maybe a first question: why don't i get a classname for each serialized
object in
common_oarchive::save_override(const class_name_type & t, int)?
sometimes i get a class_id, sometimes a class_reference_id and so on.
classnames
are offered rarely.

regards,
jabe


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