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