[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: "Introducing MicroXML, Part 1: Explore the basicprinciples
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|