<p>For me <strong>usable</strong> means that:</p>

<ul>
<li>it's being used in real-wold</li>
<li>it has tools support. (at least some simple editor)</li>
<li>it has human readable syntax (no angle brackets please) </li>
</ul>

<p>Also I want it to be as close to XML as possible, i.e. there must be support for attributes as well as for properties. So, no <a href="http://en.wikipedia.org/wiki/YAML" rel="noreferrer">YAML</a> please. Currently, only one matching language comes to my mind - <a href="http://en.wikipedia.org/wiki/JSON" rel="noreferrer">JSON</a>. Do you know any other alternatives?</p>

[{'answer_id': 51494, 'author': 'Staale', 'author_id': 3355, 'author_profile': 'https://Stackoverflow.com/users/3355', 'pm_score': 4, 'selected': False, 'text': '<p><a href="http://www.json.org/" rel="nofollow noreferrer">JSON</a> is a very good alternative, and there are tools for it in multiple languages. And it\'s really easy to use in web clients, as it is native javascript.</p>\n'}, {'answer_id': 51496, 'author': 'Pat', 'author_id': 238, 'author_profile': 'https://Stackoverflow.com/users/238', 'pm_score': 2, 'selected': False, 'text': '<p>I would recommend JSON ... but since you already mentioned it maybe you should take a look at <a href="http://google-opensource.blogspot.com/2008/07/protocol-buffers-googles-data.html" rel="nofollow noreferrer">Google protocol buffers</a>.</p>\n\n<p>Edit: Protocol buffers are made to be used programatically (there are bindings for c++, java, python ...) so they may not be suited for your purpose.</p>\n'}, {'answer_id': 51498, 'author': 'epatel', 'author_id': 842, 'author_profile': 'https://Stackoverflow.com/users/842', 'pm_score': 2, 'selected': False, 'text': '<p>I think <a href="http://www.clearsilver.net/" rel="nofollow noreferrer">Clearsilver</a> is a very good alternative. They even have a comparison page <a href="http://www.clearsilver.net/docs/compare_w_xmlxslt.hdf" rel="nofollow noreferrer">here</a> and a list of <a href="http://www.clearsilver.net/examples.hdf" rel="nofollow noreferrer">projects</a> that use it</p>\n'}, {'answer_id': 51517, 'author': 'Giovanni Galbo', 'author_id': 4050, 'author_profile': 'https://Stackoverflow.com/users/4050', 'pm_score': 3, 'selected': False, 'text': '<p>Jeff wrote about this <a href="http://www.codinghorror.com/blog/archives/001114.html" rel="noreferrer">here</a> and <a href="http://www.codinghorror.com/blog/archives/001139.html" rel="noreferrer">here</a>.  That should help you get started.</p>\n'}, {'answer_id': 51521, 'author': 'dbr', 'author_id': 745, 'author_profile': 'https://Stackoverflow.com/users/745', 'pm_score': 2, 'selected': False, 'text': "<p>You're demands are a bit impossible.. You want something close to XML, but reject probably the closest equivalent that doesn't have angle-bracket (YAML).</p>\n\n<p>As much as I dislike it, why not just use XML? You shouldn't ever have to actually read XML (aside from debugging, I suppose), there are an absurd amount of tools about for it.</p>\n\n<p>Pretty much anything that isn't XML isn't going to be as widely used, thus there will be less tool support.</p>\n\n<p>JSON is probably about equivalent, but it's pretty much equally unreadable.. but again, you shouldn't ever have to actually read it (load it into whatever language you are using, and it should be transformed into native arrays/dicts/variables/whatever). </p>\n\n<p>Oh, I do find JSON <em>far</em> nicer to parse than XML: I've used it in Javascript, and the simplejson Python module - about one command and it's nicely transformed into a native Python dict, or a Javascript object (thus the name!)</p>\n"}, {'answer_id': 51562, 'author': 'David Crow', 'author_id': 2783, 'author_profile': 'https://Stackoverflow.com/users/2783', 'pm_score': 1, 'selected': False, 'text': '<p>If you\'re allergic to angle brackets, then JSON, <a href="http://www.clearsilver.net/docs/man_hdf.hdf" rel="nofollow noreferrer">HDF</a> (ClearSilver), and <a href="http://ogdl.sourceforge.net/" rel="nofollow noreferrer">OGDL</a> are the only ones I know offhand.</p>\n\n<p>After a bit of googling, I also found a list of alternatives here:<br/>\n<a href="http://web.archive.org/web/20060325012720/www.pault.com/xmlalternatives.html" rel="nofollow noreferrer">http://web.archive.org/web/20060325012720/www.pault.com/xmlalternatives.html</a></p>\n'}, {'answer_id': 51580, 'author': 'rjmunro', 'author_id': 3408, 'author_profile': 'https://Stackoverflow.com/users/3408', 'pm_score': 0, 'selected': False, 'text': '<p>AFAIK, JSON and YAML are exactly equivalent in data structure terms. YAML just has less brackets and quotes and stuff. So I don\'t see how you are rejecting one and keeping the other.</p>\n\n<p>Also, I don\'t see how XML\'s angle brackets are less "human readable" than JSON\'s square brackets, curly brackets and quotes.</p>\n'}, {'answer_id': 2567924, 'author': 'Ari', 'author_id': 307804, 'author_profile': 'https://Stackoverflow.com/users/307804', 'pm_score': 7, 'selected': True, 'text': '<p>YAML is a 100% superset of JSON, so it doesn\'t make sense to reject YAML and then consider JSON instead.  YAML does everything JSON does, but YAML gives so much more too (like references).</p>\n\n<p>I can\'t think of anything XML can do that YAML can\'t, except to validate a document with a DTD, which in my experience has never been worth the overhead.  But YAML is so much faster and easier to type and read than XML.</p>\n\n<p>As for attributes or properties, if you think about it, they don\'t truly "add" anything... it\'s just a notational shortcut to write something as an attribute of the node instead of putting it in its own child node. But if you like that convenience, you can often emulate it with YAML\'s inline lists/hashes. Eg:</p>\n\n<pre><code>&lt;!-- XML --&gt;\n&lt;Director name="Spielberg"&gt;\n    &lt;Movies&gt;\n        &lt;Movie title="Jaws" year="1975"/&gt;\n        &lt;Movie title="E.T." year="1982"/&gt;\n    &lt;/Movies&gt;\n&lt;/Director&gt;\n\n\n# YAML\nDirector: \n    name: Spielberg\n    Movies:\n      - Movie: {title: E.T., year: 1975}\n      - Movie: {title: Jaws, year: 1982}\n</code></pre>\n\n<p>For me, the luxury of not having to write each node tag twice, combined with the freedom from all the angle-bracket litter makes YAML a preferred choice.  I also actually like the lack of formal tag attributes, as that always seemed to me like a gray area of XML that needlessly introduced two sets of syntax (both when writing and traversing) for essentially the same concept.  YAML does away with that confusion altogether.</p>\n'}, {'answer_id': 5623293, 'author': 'Ferruccio', 'author_id': 4086, 'author_profile': 'https://Stackoverflow.com/users/4086', 'pm_score': 3, 'selected': False, 'text': '<p>I have found <a href="http://en.wikipedia.org/wiki/S-expression" rel="noreferrer">S-Expressions</a> to be a great way to represent structured data. It\'s a very simple format which is easy to generate and parse. It doesn\'t support attributes, but like YAML &amp; JSON, it doesn\'t need to. Attributes are simply a way for XML to limit verbosity. Simpler, cleaner formats just don\'t need them.</p>\n'}, {'answer_id': 6908397, 'author': 'Martin Vahi', 'author_id': 855783, 'author_profile': 'https://Stackoverflow.com/users/855783', 'pm_score': 0, 'selected': False, 'text': '<p>There are truly plenty of alternatives to XML, but the main problem with many of them seems to be that libraries might not be available for every language of choice and the libraries are relatively laborious to implement. </p>\n\n<p>Parsing a tree structure itself might not be that pleasant, if compared to key-value pairs, e.g. hash tables. If a hash table instance meets the requirement that all of its keys are strings and all of its values are strings, then it\'s relatively non-laborous to implement hashtable2string() and string2hashtable().</p>\n\n<p>I\'ve been using the hash table serialization in AJAX between PHP and JavaScript and the format that I\'ve developed, is called ProgFTE (Programmer Friendly text Exchange) and is described at:</p>\n\n<p><a href="http://martin.softf1.com/g/n//a2/doc/progfte/index.html" rel="nofollow">http://martin.softf1.com/g/n//a2/doc/progfte/index.html</a></p>\n\n<p>One can find a Ruby version of the ProgFTE implementation as part of the Kibuvits Ruby Library:\n<a href="http://rubyforge.org/projects/kibuvits/" rel="nofollow">http://rubyforge.org/projects/kibuvits/</a></p>\n'}, {'answer_id': 15808838, 'author': 'gtd', 'author_id': 8376, 'author_profile': 'https://Stackoverflow.com/users/8376', 'pm_score': 2, 'selected': False, 'text': '<p>YAML is extremely fully-featured and generally human-readable format, but it\'s Achilles heal is complexity as demonstrated by the Rails vulnerabilities we saw this winter.  Due to its ubiquity in Ruby as a config language Tom Preston-Werner of Github fame stepped up to create a sane alternative dubbed TOML. It gained massive traction immediately and has great tool support.  I highly recommend anyone looking at YAML check it out:</p>\n\n<p><a href="https://github.com/mojombo/toml" rel="nofollow">https://github.com/mojombo/toml</a></p>\n'}, {'answer_id': 20362887, 'author': 'Qwertie', 'author_id': 22820, 'author_profile': 'https://Stackoverflow.com/users/22820', 'pm_score': 2, 'selected': False, 'text': '<p>For storing code-like data, <a href="http://loyc.net/les/" rel="nofollow noreferrer">LES</a> (Loyc Expression Syntax) is a budding alternative. I\'ve noticed a lot of people use XML for code-like constructs, such as build systems which support conditionals, command invocations, sometimes even loops. These sorts of things look natural in LES:</p>\n\n<pre><code>// LES code has no built-in meaning. This just shows what it looks like.\n[DelayedWrite]\nOutput(\n    if version &gt; 4.0 {\n        $ProjectDir/Src/Foo;\n    } else {\n        $ProjectDir/Foo;\n    }\n);\n</code></pre>\n\n<p>It doesn\'t have great tool support yet, though; currently the only LES library is for C#. Currently only one app is known to use LES: <a href="http://www.codeproject.com/Articles/664785/A-New-Parser-Generator-for-Csharp" rel="nofollow noreferrer">LLLPG</a>. It supports "attributes" but they are like C# attributes or Java annotations, not XML attributes.</p>\n\n<p>In theory you could use LES for data or markup, but there are no standards for how to do that:</p>\n\n<pre><code>body {\n    \'\'\'Click here to use the World\'s \'\'\'\n    a href="http://google.com" {\n        strong "most popular"; " search engine!"\n    };\n};\n\npoint = (2, -3);\ntasteMap = { "lemon" -&gt; sour; "sugar" -&gt; sweet; "grape" -&gt; yummy };\n</code></pre>\n'}, {'answer_id': 30144859, 'author': 'intellimath', 'author_id': 4743644, 'author_profile': 'https://Stackoverflow.com/users/4743644', 'pm_score': 2, 'selected': False, 'text': '<p>There is <a href="http://intellimath.bitbucket.org/axon" rel="nofollow noreferrer">AXON</a> that cover the best of XML and JSON. Let\'s explain that in several examples.</p>\n\n<p><strong>AXON could be considered as shorter form of XML data.</strong> </p>\n\n<p>XML</p>\n\n<pre><code>&lt;person&gt;\n   &lt;name&gt;Frank Martin&lt;/name&gt;\n   &lt;age&gt;32&lt;/age&gt;\n &lt;/person&gt;\n</code></pre>\n\n<p>AXON</p>\n\n<pre><code>person{\n  name{"Frank Martin"}\n  age{32}}\n</code></pre>\n\n<p>or </p>\n\n<pre><code>person\n  name:\n    "Frank Martin"\n  age:\n    32\n</code></pre>\n\n<p>XML</p>\n\n<pre><code>&lt;person name="Frank Martin" age="32" /&gt;\n</code></pre>\n\n<p>AXON</p>\n\n<pre><code>person{name:"Frank Martin" age:32}\n</code></pre>\n\n<p>or </p>\n\n<pre><code>person\n  name: "Frank Martin"\n  age: 32\n</code></pre>\n\n<p><strong>AXON contains some form of JSON.</strong></p>\n\n<p>JSON</p>\n\n<pre><code>{"name":"Frank Martin" "age":32 "birth":"1965-12-24"}\n</code></pre>\n\n<p>AXON</p>\n\n<pre><code>{name:"Frank Martin" age:32 birth:1965-12-24}\n</code></pre>\n\n<p><strong>AXON can represent combination of XML-like and JSON-like data.</strong></p>\n\n<p>AXON</p>\n\n<pre><code>table {\n  fields {\n    ("id" "int") ("val1" "double") ("val2" "int") ("val3" "double")\n  }\n  rows {\n    (1 3.2 123 -3.4)\n    (2 3.5 303 2.4)\n    (3 2.3 235 -1.2)\n  }\n}\n</code></pre>\n\n<p>or </p>\n\n<pre><code>table\n  fields\n    ("id" "int")\n    ("val1" "double")\n    ("val2" "int") \n    ("val3" "double")\n  rows\n    (1 3.2 123 -3.4)\n    (2 3.5 303 2.4)\n    (3 2.3 235 -1.2)\n</code></pre>\n\n<p>There is available the python library <a href="http://pypi.python.org/pypi/pyaxon" rel="nofollow noreferrer">pyaxon</a> now.</p>\n'}, {'answer_id': 39035417, 'author': 'wvxvw', 'author_id': 5691066, 'author_profile': 'https://Stackoverflow.com/users/5691066', 'pm_score': 3, 'selected': False, 'text': '<h1>TL;DR</h1>\n<p>Prolog wasn\'t mentioned here, but it is the best format I know of for representing data.  Prolog programs, essentially, describe databases, with complex relationships between entities.  Prolog is dead-simple to parse, whose probably only rival is S-expressions in this domain.</p>\n<h1>Full version</h1>\n<p>Programmers often &quot;forget&quot; what XML actually consists of.  Usually referring to a very small subset of what it is.  XML is a very complex format, with at least these parts: <a href="https://www.w3.org/TR/xmlschema-1/" rel="noreferrer">DTD schema language</a>, <a href="https://www.w3.org/TR/xmlschema11-1/" rel="noreferrer">XSD schema language</a>, <a href="https://www.w3.org/TR/xslt20/" rel="noreferrer">XSLT transformation language</a>, <a href="https://www.oasis-open.org/committees/relax-ng/spec-20011203.html" rel="noreferrer">RNG schema language</a> and <a href="https://www.w3.org/TR/xpath-31/" rel="noreferrer">XPath</a> (plus XQuery) languages - they all are part and parcel of XML standard.  Plus, there are some apocrypha like <a href="http://www.ecma-international.org/publications/files/ECMA-ST-WITHDRAWN/Ecma-357.pdf" rel="noreferrer">E4X</a>.  Each and every one of them having their own versions, quite a bit of overlap, incompatibilities etc.  Very few XML parsers in the wild implement all of them.  Not to mention the multiple quirks and bugs of the popular parses, some leading to notable security issues like <a href="https://en.wikipedia.org/wiki/XML_external_entity_attack" rel="noreferrer">https://en.wikipedia.org/wiki/XML_external_entity_attack</a> .</p>\n<p>Therefore, looking for an XML <em>alternative</em> is not a very good idea.  You probably don\'t want to deal with the likes of XML at all.</p>\n<p>YAML is, probably, the second worst option.  It\'s not as big as XML, but it was also designed in an attempt to cover all bases... more than ten times each... in different and unique ways nobody could ever conceive of.  I\'m yet to hear about a properly working YAML parser.  Ruby, the language that uses YAML a lot, had famously <a href="https://www.sitepoint.com/anatomy-of-an-exploit-an-in-depth-look-at-the-rails-yaml-vulnerability/" rel="noreferrer">screwed up</a> because of it.  All YAML parsers I\'ve seen to date are copies of <a href="https://bitbucket.org/xi/libyaml" rel="noreferrer">libyaml</a>, which is itself a hand-written (not a generated from a formal description) kind of parser, with a code which is very difficult to verify for correctness (functions that span hundreds of lines with convoluted control flow).  As was already mentioned, it completely contains JSON in it... on top of a handful of Unicode coding techniques... inside the same document, and probably a bunch of other stuff you don\'t want to hear about.</p>\n<p>JSON, on the other hand, is completely unlike the other two. You can probably write a JSON parser while waiting for downloading JSON parser artefact from your Maven Nexus.  It can do very little, but at least you know what it\'s capable of.  No surprises.  (Except some discrepancies related to character escaping in strings and doubles encoding).  No covert exploits.  You cannot write comments in it.  Multiline strings look bad.  Whatever you mean by distinction between properties and attributes you can implement by more nested dictionaries.</p>\n<p>Suppose, though you wanted to right what XML wronged... well, then the popular stuff like YAML or JSON won\'t do it.  Somehow fashion and rational thinking parted ways in programming some time in the mid seventies.  So, you\'ll have to go back to where it all began with McCarthy, Hoare, Codd and Kowalski, figure out what is it you are trying to represent, and then see what\'s the best representation technique there is for whatever is that you are trying to represent :)</p>\n'}]
['https://Stackoverflow.com/questions/51492', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1196/']