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] {mark} - a new simple notation that unifies JSON and XML

I agree with Eliot that without a proper representation of mixed content no new format can  subsume XML.  I would urge you to look at FtanML by Michael Kay and friends at <https://www.balisage.net/Proceedings/vol10/html/Kay01/BalisageVol10-Kay01.html> for something that truly does subsume both JSON and XML; though it is not 100% syntactically compatible with either, its syntax is easy to learn.  In addition, it comes with its own powerful schema and transformation languages.  Here's the famous purchase order example, with mixed content enclosed in |...| (it is also valid to use «...» instead, which is harder to type but makes nested mixed content easier to see):

<purchaseOrder 
   orderDate="1999-10-20" 
   shipTo = <country="US" [
      <name "Alice Smith">
      <street "123 Maple Street">
      <city "Mill Valley">
      <state "CA">
      <zip 90952>
   ]>
   billTo = <country="US" [
      <name "Robert Smith">
      <street "8 Oak Avenue">
      <city "Old Town">
      <state "PA">
      <zip 95819>
   ]>
   comment = |<emph |Hurry|>, my lawn is going wild|
   items = [
      <  partNum="872-AA"
         productName="Lawnmower"
         quantity=1
         USPrice=148.95
         comment=|Confirm this is <strong |electric|>|
      >
      <  partNum="926-AA"
         productName="Baby Monitor"
         quantity=1
         USPrice=39.98
         shipDate="1999-05-21"
      >
   ]
>

And here's the corresponding schema:

 <org_ftanml_schema [
  <import "ftan_calendar.ftg">
  <types
   purchaseOrderType = 
     <element form=<purchaseOrder 
                      shipTo=<addressType>
                      billTo=<addressType>
                      comment=<nullable<text elements=<inlineType>>>
                      items=<occurs=[1,] <itemType>>
     >
   addressType = 
     <element form=<  country=<eq="US">
                      <seq [ <element form=<name <string>>>,
                             <element form=<street <string>>>,
                             <element form=<city <string>>>,
                             <element form=<state <string>>>,
                             <element form=<zip <number>>>]>
     >
   itemType =
     <element form=<  partNum=<SKUType>
                      productName=<string>
                      quantity=<number ge=1 lt=100 step=1>
                      USPrice=<number ge=0 step=0.01>
                      comment=<nullable<text elements=<inlineType>>>
                      shipDate=<nullable<org_ftanml_calendar_dateType>>
                   >
     >
   inlineType = 
     <element elemName=<enum=["ital", "bold"]> 
              form=<<inlineType>>
     > 
   SKUType = <string pattern="\[#\d{3}-[A-Z]{2}#]">  
  >   
]>


[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