Boost logo

Boost Users :

From: Delfin Rojas (drojas_at_[hidden])
Date: 2006-06-20 13:02:37


> Pierre THIERRY wrote:
>
> I'm pretty sure XML is order-dependent. Some languages whose
> syntax is based on XML could have a semantic that is
> independant of the order of the tags in the document, like
> RDF/XML, but different ordering of the tags produce different
> XML documents and different XML infosets...
>

I'm sorry to disagree but each XML element can be order-dependent or not
according to the XML schema used. In the XML schemas you can specify the
sub-elements of a given element must appear on a given order or you can
specify sub-elements can appear in any order and in any amount. Furthermore,
you can specify if an element may contain new sub-elements (open content
model) or only those sub-elements specified in the schema (closed content
model).

However, boost::serialization doesn't care about XML schemas and the current
serialization xml archive seems to use a SAX-style parsing to process the
XML document so it must be order-dependent. If the XML were parsed via a DOM
then elements and attributes could be requested in any order but as Robert
Ramey said, you would need to load the whole XML in memory which is overkill
for many applications. Hopefully somebody will have the time to build a
DOM-parsing XML archive and then developers can select SAX or DOM parsing
depending on the application.

Just my 2 cents,

-delfin


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