RE: Subset Data Model

The api's that are used to read XML can also be used to read uxml. But it wouldn't be unusual for an application to use one of those api's to read, say uxml, then modify the model the api produces, then serialize the results. I don't think there is anything that would guarantee that an xml api that read uxml would then serialize to uxml. Is that an issue?

Dan

-----Original Message-----
From: John Cowan [mailto:cowan@ccil.org] On Behalf Of John Cowan
Sent: Monday, August 13, 2012 11:29 AM
To: David Lee
Cc: public-microxml (public-microxml@w3.org)
Subject: Re: Subset Data Model

David Lee scripsit:
> At  Balisage (especially after Johns great talk) I had some more 
> discussions with people about MicroXML ... One issue arose which I 
> suggest needs serious discussion.
> 
> For good reasons (and ones I agree with) If MicroXML is to be successful
> as an XML 'drop in' it needs to be a pure subset.   That is, as stated
> in the specs any valid MicroXML document is a valid XML Document.

Note that MicroXML is not intended as a drop-in replacement for XML.
I won't press that point, however, as it may be that it will become so.
In which case I'll just note that the XML data model has nothing to do with the SGML (HyTime) data model.

> But I fear that is not enough.   If MicroXML is creating its own
> DataModel I suggest the DataModel needs to be equivalently compatible
> with the XML Data Model (XDM).    That is, given an MicroXML Document.
> If it is parsed by an XML parser and a MicroXML Parsers, the two data
> models should be compatible.   The MicroXML Data Model should be a
> subset of the XML Data Model  *AND*  the instance of the data model 
> generated should be compatible (subset of) the data model produced by 
> the same document in an XML parser.

Here's an analogy.  There is XML syntax and the XML data model.  There is also JSON syntax and a (loosely defined, but fairly obvious) JSON data model..  XML parsers accept the XML syntax and return some concrete representation of the XML data model.  JSON parsers accept the JSON syntax and return some concrete representation of the JSON data model.

But it is also possible to write a parser that accepts XML and returns a JSON data model, as well as a parser that accepts JSON and returns an XML data model.  There is no one-to-one or even subset mapping, so this is not usually provided as a utility but rather is done ad hoc.

In the case of MicroXML, keeping the syntax a subset means that in order to parse MicroXML and return an XML data model, you just use an XML parser, which already exists.  It would also be easy to write a parser that accepted XML and returned the MicroXML data model: for example, a SAX handler that provided MicroLark events to a MicroLark handler, dropping all other events on the floor, or a MicroLark tree builder that walked an XML DOM.

-- 
John Cowan    http://ccil.org/~cowan  cowan@ccil.org
The Penguin shall hunt and devour all that is crufty, gnarly and bogacious; all code which wriggles like spaghetti, or is infested with blighting creatures, or is bound by grave and perilous Licences shall it capture.  And in capturing shall it replicate, and in replicating shall it document, and in documentation shall it bring freedom, serenity and most cool froodiness to the earth and all who code therein.  --Gospel of Tux

Received on Tuesday, 14 August 2012 06:43:47 UTC