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: Not using mixed content? Then don't use XML

Hi Roger,

I find the mixed-content / data separation not too relevant.  Readability , programmability, performance are all important.  HTML is more or less a  presentation-specific vocabulary for XML, but it's not because it allows mixed content that people don't complain about *its* angle brackets.  Its because it has native hypermedia constructs built in, which provides the big gain for clients.  Even though XML lacks native hypermedia support, the Atom formats provide the essentials, allowing you to serve mixed content or data encodings with one simple syntax.   

I first was attracted to XML and XSLT partly because of the uniformity of syntax (notwithstanding DTDs CDATAs and other holdovers from SGML).    In my opinion, less time spent thinking about syntax lowers the bar for use of a format.  JSON is definitely less readable, but the ease with which you can use JSON in web browsers makes up for that (apparently, I'm not a javascript programmer, however).  

Web browsers aren't the only programming platform, nor REST the only architecture.  Unfortunately, web browsers haven't created good support for XML, perhaps because XML doesn't have good support for the Web.  So HTML hits a sweet spot for the web,  but XML decided to aim for a different target.


Regards,
Peter Rushforth

________________________________________
From: Costello, Roger L. [costello@mitre.org]
Sent: March 23, 2013 11:04 AM
To: xml-dev@lists.xml.org
Subject: [xml-dev] Not using mixed content? Then don't use XML

Hi Folks,

First a few definitions:

----------------
Sweet spot
----------------
    A place where there a maximum response for
    a given amount of effort.

--------------------
Mixed content
--------------------
    An element has mixed content if its content is a
    mix of data and elements. Here is an example of
    mixed content:

    <condition>The patient exhibited <emp>extreme</emp>
                       arrhythmia</condition>

--------------------------------------------------------------
Data-centric versus Document-centric content
--------------------------------------------------------------
    Data-centric content is where there is no mixed content,
    document-centric content is where there is mixed content.

-----------------------------
Semi-structured data
-----------------------------
    A synonym for mixed content.


Okay, now for the issue at hand:

    Should you use XML?


Sean McGrath says [1]:

    XML's sweet spot is mixed content.

    If you are not using mixed content, then there
    are a trillion and one ways of representing data-centric
    content, most programming languages do it out-of-the-box.

    If you absolutely, totally, never, ever will need mixed
    content then there are sane alternatives to XML.

    There always has been alternatives, from humble CSV up to
    fancier JSON/Python/Ruby direct data expression languages.

    A huge chunk of the world doesn't need mixed content or
    even know what it is.

    It has always been a source of worry that folks with perfectly
    good relational data sets have felt compelled by buzz-pressure
    to put their content into XML - very little gain in the general case.


Professor Daniel Lemire says [2]:

    XML is great for dealing with semi-structured data.

    Alas, we ended up torturing XML by applying it to ill-suited
    purposes.

    We must learn how to select the best format. Does your data
    look like a table? Can a flat file do the job? Do you need a
    key-value format like JSON? Or maybe a simple text file?
    Take a good look at your data before picking a format for it.


Conclusion:
    If your problem doesn't need mixed content, then don't use XML.

Comments?

/Roger

[1] http://seanmcgrath.blogspot.com/2007/01/mixed-content-trying-to-understand-json.html

[2] http://lemire.me/blog/archives/2010/11/17/you-probably-misunderstand-xml/

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



[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