[Serialization, XML] - how to avoid another encoding level
Hi,
i am working with MICO and use boost::serialization (XML) for import/export of CORBA functions IN/OUT parameters, because i have an XML formatted configuration for the data to use for CORBA service invocations.
One of the problems was, that some of the MICO are template'd.
E.g. a data type holding a number of digits (e.g. telephone #no) is encoded in MICO as:
template
What you want to do is to derive your own variation of xml_oarchive with special handling for this special type. Actually I'm amazed you've got this far trying to match an external format without doing this. Look in the document under Case Studies/deriving from an archive and the example demo_fast_archive which shows how to do this. Robert Ramey Frank Bergemann wrote:
using pInstance.imsi directly (which is a BoundedSequenceTmplCORBA::Short()) resulted in:
<imsi> // dropped boost::serializations internal XML attributes here <hallo>SomeString</hallo> </imsi>
But I would like to have this one
<imsi>SomeString</imsi>
How can i do that?
Thanks!
Best regards!
Frank
_______________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
Robert Ramey schrieb:
What you want to do is to derive your own variation of xml_oarchive with special handling for this special type. Actually I'm amazed you've got this far trying to match an external format without doing this.
me too :-)
Look in the document under Case Studies/deriving from an archive and the example demo_fast_archive which shows how to do this.
- thanks for the hint, i'll check this.
Up to now i could at least get rid of the separate ToString()
FromString() functions - temporary accepting the additional nesting level.
BTW:
Another way, which i tried to fix the originally reported problem, was
to public derive from class boost::serialization::nvp and using a
conversion constructor in the derived one for my data type:
// a sub-class to nvp, which has a conversion c'tor for my troublesome
// BoundedSequenceTmpl
Robert Ramey
Frank Bergemann wrote:
using pInstance.imsi directly (which is a BoundedSequenceTmplCORBA::Short()) resulted in:
<imsi> // dropped boost::serializations internal XML attributes here <hallo>SomeString</hallo> </imsi>
But I would like to have this one
<imsi>SomeString</imsi>
How can i do that?
Thanks!
Best regards!
Frank
_______________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
of course i will check the way you proposed... Because my other attempt (mentioned above) implies to use a new defined MyNVP - which burdens the user to make a difference. It was just as a matter of interest (this public derive from boost::serialization::nvp thing) \Frank
participants (2)
-
Frank Bergemann
-
Robert Ramey