Boost logo

Boost Users :

From: Todd Greer (TGreer_at_[hidden])
Date: 2006-07-21 12:24:06


Peter wrote:
> The additional need I'm trying to solve is that the XML elements can
be
> reordered, i.e. come in a different order than the serialization lib
> expects them.

You could store whatever XML elements you skip. Then, every time you get
a request to read something, first check the stored XML. You would need
to have a stack of storage locations to correspond to how deep you are
in the XML hierarchy and discard the XML elements on the top of the
stack when you parse an end tag.

I think that would work, as long as you don't mind having to buffer some
XML. Another approach would be to store pointers to the variables that
are passed into the serialization library, rather than storing the XML.
Then, when reading an XML open tag, look in your set of stored pointers
for a match and deserialize into it. I'm not sure whether or not this
could be made to work with the current Serialization library.

Basically, to support reordering, you need to buffer one side or the
other. Buffering the XML would probably work better with the current
Serialization library, but would be less efficient.

HTH,
Todd Greer <tgreer <at> affinegy dot com>
Senior Software Developer, Affinegy LLC


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