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

Re: Re: The Goals of XML at 25, and the one thing that XMLnow

  • From: John Cowan <johnwcowan@gmail.com>
  • To: Rick Jelliffe <rjelliffe@allette.com.au>
  • Date: Thu, 22 Jul 2021 20:56:46 -0400

Re:  Re: The Goals of XML at 25


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]


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.