XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Re: The Goals of XML at 25, and the one thing that XMLnow needs



On Wed, Jul 21, 2021 at 9:19 PM Rick Jelliffe <rjelliffe@allette.com.au> wrote:
 
That has many great ideas, and I like that they add delimiters. It was a valuable excercise. But its premise, 100% round-tripping with JSON, is the opposite of mine. 

Round-tripping with XML, JSON, or anything else is explicitly a non-goal, though it is not an anti-goal in the sense that the FtanML designers were forbidden to do so.
 
And what does FtanML show, really?  That when you do attempt a JSON with XML delimiters, you dont get a thing that looks like XML (or which existing XML systems could support with trivial tweaks) much anyway.

Actually it isn't.  The value types null, boolean, string, and list are shared (and can be round-tripped through XML using xsi:null and xsi:type).  However, there is no JSON equivalent to a FtanML rich-text value (it is not the same as a list of strings-and-elements).  Furthermore, although a FtanML element can emulate a JSON object, it extends one in three ways:
  1. an optional name: no JSON equivalent, XML element names are required.
  2. an optional content value: no JSON equivalent, XML equivalents are element content (a list of FtanML elements), mixed content (a FtanML rich-text object), or empty content (leave the content out).
  3. attribute values can be any value, not just strings as in JSON or XML.
The last two points greatly simplify the RELAX NG style schema language, FtanGram, making it look more like Examplotron, as well as the XSLT analogue, FtanSkrit.  For example, here is part of the FtanGram schema for a FtanML version of the infamous purchase-order example:

     <element form=<purchaseOrder 
                      shipTo=<addressType>
                      billTo=<addressType>
                      comment=<nullable<text elements=<inlineType>>>
                      items=<occurs=[1,] <itemType>>
     >
This declares the constraints on an element named purchaseOrder, namely that:
  1.  its shipTo and billTo attributes are of type addressType (an element whose schema is given elsewhere);
  2. it has a comment attribute which can be null (same as being omitted) or can have rich text whose elements are of the inlineType type (defined elsewhere either italic or bold elements) as its value;
  3. an item that occurs 1 or more times of type itemType, which is a list of one or more anonymous elements containing various attributes,
Note that everything in purchaseOrder is an attribute, because why not? Order doesn't matter here. In XML and JSON that's impossible, because attribute values are restricted to strings.


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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS