[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: "Introducing MicroXML, Part 1: Explore the basicprinciples

  • From: John Cowan <cowan@mercury.ccil.org>
  • To: James Clark <jjc@jclark.com>
  • Date: Sun, 15 Jul 2012 16:48:04 -0400

Re:  "Introducing MicroXML
James Clark scripsit:

> But if you put arbitrary PIs in the data model, you are, of course,
> significantly complicating things (going from 2 kinds of content to
> 3).

What is worse, you go from Element objects to Document, PI, and Element
objects.

> The start-tag syntax restriction also means you can't encode arbitrary
> XML infosets.

True.

> - allow PIs only before the root element (and perhaps only before the
> DOCTYPE if there is one), probably with the start-tag syntax
> restriction

How about placing them under, rather than adjacent to, the root element?
There is no real semantic distinction between one and the other, and
that would eliminate the need for a separate Document object in the model.

> - encode elements differently: an element is represented by a JSON
> object, with each attribute represented as a property of the object;
> the element name and content would be represented by properties whose
> name starts with "$", so  that are not legal XML names but are legal
> JavaScript identifiers eg $name/$content or something shorter.

The content should be just $, I think.  But I really hate to introduce
yet another mapping from XML to JSON; at least the ones I document already
exist and have some support behind them.

> - encode PIs before the root element as a "$" prefixed property of the
> root element eg $pi

This corresponds to what I mentioned above.

> - consider adding DOCTYPE to the data model as well using similar
> techniques (not sure about this, but it's going to be difficult for
> serializers to know whether to output a DOCTYPE otherwise)

I think that should be an implementation-level switch rather than
something in the data model, since it depends on the context in which
the MicroXML document is to be consumed.

-- 
Ambassador Trentino: I've said enough. I'm a man of few words.
Rufus T. Firefly: I'm a man of one word: scram!
        --Duck Soup                     John Cowan <cowan@ccil.org>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.