Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-11-19 08:26:00


Robert Ramey <ramey_at_[hidden]> writes:

> Is there a reason you sent this to me privately?
>> From: David Abrahams <dave_at_[hidden]>
>
>>I believe your assessment that some
>>data structures can't be represented using XML is incorrect, and
>>that's easy to prove. A serialization library which makes generation
>>of XML output difficult is severely handicapped in the modern world.
>
> Well, I have conceded that it was preliminary. All I know about XML
> is from a small book containing a concise description of XML.
>
> My skeptism is based on the following thought experiment:
> Suppose on is given a list of polymorphic pointers, some of which
> correspond to bottom node of a diamond in heritance structure
> and some of which are repeated in the list and serialized
> some where else as well.
>
> a) How would such a thing be represented in XML?

I'm not an XML expert, but I know a little. It's basically a tree
structure with cross-references. That means you can represent an
arbitrary graph. If the pointers all correspond to the bottom node in
a diamond, the problem is actually relatively easy, since you don't
have to worry about ambiguous subobjects of the same type. Repetitions
in the list could be handled with cross-references. Alternatively, the
whole list of pointers could be handled with cross-references, and the
set of objects in question could be stored in a separate XML
structure. I probably haven't given enough detail here to be
convincing. Some handwaving on my part is a product of not knowing
somie XML details.

> b) Could be loaded back to create an equivalent structure?

Sure, why not?

> c) Would it be useful for anything other than this serialization system?

Why is that an important question?

> If someone can assure me that the answers to all three of the above
> is yes then it should be possible - otherwise not. Given that its
> "easy to prove" these questions should be easy to answer in
> a convincing way.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk