I like Turtle: dc:title "RDF/XML Syntax Specification (Revised)" ; ex:editor [ ex:fullname "Dave Beckett"; ex:homePage ] . It's only useful if you drank the RDF kool-aid (like I have), though.
You have good taste, since I invented Turtle. To keep this on topic, I've been using JSON for data web APIs since that's what it's best at. It sucks at: markup and graphs of course.
JSON or XML: Just Decide
21–30 of 44 posts
Re: JSON or XML: Just Decide
#22Or... they're designed for different purposes and not even competitors. XML is a markup language: http://en.wikipedia.org/wiki/Markup_language It was designed for documents. Try converting an HTML page to JSON. Try something as simple as: Hello World! The most common introductory program is called Hello, World . Go on. If you think JSON wins, just do it, and post it below. The problem was when people started mis-appl…
Re: JSON or XML: Just Decide
#23I didn't see any example within the article regarding JSON formats that generate awkard XML ad vice versa. Does anyone have examples of that?
Re: JSON or XML: Just Decide
#24JSON is great, but it is not nearly as flexible as XML, partly because of attributes. Also, because of it's JS heritage and compatibility, lots of common things are not representable in JSON. This is mostly because object keys MUST be strings. Examples: In [1]: from simplejson import dumps In [2]: dumps({1: 5, '1': 0}) Out[2]: '{"1": 0, "1": 5}' Derp, good luck figuring out what that is supposed to mean. In [3]: dump…
>JSON is great, but it is not nearly as flexible as XML, partly because of attributes.
Attributes can be stored in JSON as well. XML and JSON simply store data in different ways.
>Also, because of it's JS heritage and compatibility, lots of common things are not representable in JSON.
Like what? You can actually put real values in their correct types with JSON. You can't do that with XML, so what types of items are not representable?
>This is mostly because object keys MUST be strings.
The same is true for XML so I'm not sure what your point is. Don't nodes and attribute names need to be strings in XML?
Re: JSON or XML: Just Decide
#25Use the right tool for the job. I wouldn't say that XML or JSON is always right. But I will say that I believe XML has a better ecosystem around it; with things like XSD, XSLT, XQuery/XPath, etc., and some pretty easy to use data-binding frameworks like JAX-B. My feeling is that XML makes it a lot easier to do certain classes of things that I want to do, like taking a business event message off a queue, match it agai…
Re: JSON or XML: Just Decide
#26Earlier quoted context omitted.
You have good taste, since I invented Turtle. To keep this on topic, I've been using JSON for data web APIs since that's what it's best at. It sucks at: markup and graphs of course.
We use JSON for graphs. What sucks about it? In what sense is XML better at representing graphs?
Re: JSON or XML: Just Decide
#27Use the right tool for the job. I wouldn't say that XML or JSON is always right. But I will say that I believe XML has a better ecosystem around it; with things like XSD, XSLT, XQuery/XPath, etc., and some pretty easy to use data-binding frameworks like JAX-B. My feeling is that XML makes it a lot easier to do certain classes of things that I want to do, like taking a business event message off a queue, match it agai…
Re: JSON or XML: Just Decide
#28Or... they're designed for different purposes and not even competitors. XML is a markup language: http://en.wikipedia.org/wiki/Markup_language It was designed for documents. Try converting an HTML page to JSON. Try something as simple as: Hello World! The most common introductory program is called Hello, World . Go on. If you think JSON wins, just do it, and post it below. The problem was when people started mis-appl…
Re: JSON or XML: Just Decide
#29I wish JSON had syntax for comments.
Then there's also YAML that supports comments.
Re: JSON or XML: Just Decide
#30Earlier quoted context omitted.
You're feigning outrage. It's a valid and well-documented design decision that keys in JSON are strings. If you want a language-specific serialization format based on JSON, come up with a dialect.
Being 'well documented' doesn't make it less of a pain.