Re: [xml-dev] Not using mixed content? Then don't use XML
Roger,
I'm currently doing a project that utilizes JSON, XML and RDF. Each has its place, and in general I'm using RDF for managing relationships in a heterogeneous environment, XML (actually RDF/XML) in order to facilitate faceted searching of text content, and JSON to interchange with the web client, as well as in a node.js server. JSON sucks as a language for text searches, where I'd argue that XML (via XQuery) is very well suited for that role. The tools for working with XML on the client are relatively primitive (Saxon-CE 1.1 may very well change that, that it's going to take a while for that sea change) but JSON has pretty much captured that space. You deal with it.
I've reached a stage where I no longer even argue the issue with people. Personally I think developers should be well versed in the four primary formats (CSV, XML, JSON, RDF, as Jenni T famously identified a few years back) even beyond knowing programming languages.
I've reached a stage where I no longer even argue the issue with people. Personally I think developers should be well versed in the four primary formats (CSV, XML, JSON, RDF, as Jenni T famously identified a few years back) even beyond knowing programming languages.
Kurt
Kurt Cagle
Invited Expert, XForms Working Group, W3C
Invited Expert, XForms Working Group, W3C
Managing Editor, XMLToday.org
443-837-8725
On Sat, Mar 23, 2013 at 4:02 PM, Simon St.Laurent <[email protected]> wrote:
The subject line has been precisely my advice for at least the last five years, at least to people who aren't especially interested in markup for the sake of markup.
Thanks,
Simon--
On 3/23/13 11:04 AM, Costello, Roger L. wrote:
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: [email protected].org
subscribe: [email protected].org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
Simon St.Laurent
http://simonstl.com/
_______________________________________________________________________
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: [email protected].org
subscribe: [email protected].org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php