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

Re: {mark} - a new simple notation that unifies JSON and XML

  • From: Michael Kay <mike@saxonica.com>
  • To: Henry Luo <henry@perpetuatech.net>
  • Date: Thu, 25 Jan 2018 18:39:16 +0000

Re:  {mark} - a new simple notation that unifies JSON and XML

That is also a concern that I have when designing Mark. Should it be generalized to allow any value in content? Do we have any solid usecase for storing number and boolean in content? They are probably not needed for normal mixed content usage.


I don't think the absence of a use case should ever be used to justify lack of orthogonality. If design were driven solely by use cases, orthogonality would go out of the window. The design process should aim to produce the most elegant/orthogonal design that satisfies all the use cases, it should not aim to satisfy the known use cases and nothing else.

Or to put it another way: find the space with the smallest boundary that has all the use cases within the space, where the "boundary" is the boundary between things that the system handles and things that it doesn't.

(An extreme example I often use to illustrate this principle: arithmetic expressions X+Y should allow either operand to be a literal zero, even though there is no use case for adding zero to a number, because a specification that allows literal zero is smaller than one that doesn't).

The lack of orthogonality between attribute values and element content was in fact one of the design mistakes in XML that I was trying to correct.

I know XML Schema allows primitive values as element content. But personally, I don't like that, and prefer to use attribute for those usecases.

Why should personal preferences come into it?

You might prefer <price currency="USD" amount="5.00"/> to <price currency="USD">5.00</price>, but others don't.

Michael Kay
Saxonica




[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.