News for hackers. Stuff that matters.
Re:Why is JSON so popular? Developers want out of the syntax... by arethuza on Thursday June 23, 2011 @07:27AM (#2687474)
If that is the worst XML that you have experienced then you have been very very lucky. I've seen stuff that:

- Has been built by string manipulation and therefore isn't well formed and needs hacky preprocessing before being parsed (no not HTML)

- Is full of redundant information (e.g. count attributes giving the number of child elements)

- Makes evil use of vast numbers of namespaces where the element names are all the same

- Is a basically a container for delimited or fixed format data

- Had attributes that contained entire encoded XML documents

<sob>

There are probably some other horrors that therapy and/or alchohol have let me forget (like systems doing SQL queries doing string compares on lumps of XML).

I really like JSON these days...

Re:Why is JSON so popular? Developers want out of the syntax... by pavel_lishin on Thursday June 23, 2011 @10:01AM (#2687857)
> - Had attributes that contained entire encoded XML documents

I've got that beat. I've dealt with XML that was basically a wrapper for JSON, which contained - you know where this is going - an XML string.

It's retarded elephants all the way down.

Re:Why is JSON so popular? Developers want out of the syntax... by RyanMcGreal on Thursday June 23, 2011 @10:09AM (#2687890)
This is getting downright Yorkshiremenesque.
Re:Why is JSON so popular? Developers want out of the syntax... by pavel_lishin on Thursday June 23, 2011 @10:14AM (#2687913)
Had to look that one up before dispensing an upvote.
Re:Why is JSON so popular? Developers want out of the syntax... by arethuza on Thursday June 23, 2011 @10:10AM (#2687893)
Notice the "encoded" - they were (if I recall correctly) base64 encoded XML documents...
Re:Why is JSON so popular? Developers want out of the syntax... by Someone on Thursday June 23, 2011 @11:31AM (#2688206)
Hm. I never heard of XJsonX, but it would be a trivial logical extension of JsonX (http://publib.boulder.ibm.com/infocenter/wsdatap/v3r8m1/inde...)
Re:Why is JSON so popular? Developers want out of the syntax... by pushingbits on Thursday June 23, 2011 @11:46AM (#2688273)
I've seen CDATA elements that contained complete XML documents including other CDATA elements. Good thing they had a hand rolled non-standard XML parser that allowed nested CDATA tags.

I noticed it when I wanted to read the doc in with tinyXML while working 70 hour weeks to fix up some other issue before a deadline. I ended up doing a memset(nestedXMLStart, ' ', nestedXMLLength) as a preprocessing step to bulldoze the whole construct. Not pretty, but it worked.

Re:Why is JSON so popular? Developers want out of the syntax... by ynniv on Thursday June 23, 2011 @11:17AM (#2688136)
Two words: external references [1].

XML is a data representation that desperately wants to be Turing complete through syntax.

And then they call their schema definition language (because defining XML schema is practical by using a specialized language) RELAX...

You can't make this stuff up.

[1|http://books.xmlschemata.org/relaxng/relax-CHP-10-SECT-1.htm...]