4 ms·
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 theref
by arethuza 15y ago
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...
- ynniv 15y agoTwo 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.html http://books.xmlschemata.org/relaxng/relax-CHP-10-SECT-1.htm...]
- pavel_lishin 15y ago> - 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.
- RyanMcGreal 15y agoThis is getting downright Yorkshiremenesque.
- pavel_lishin 15y agoHad to look that one up before dispensing an upvote.
- arethuza 15y agoNotice the "encoded" - they were (if I recall correctly) base64 encoded XML documents...
- Someone 15y agoHm. I never heard of XJsonX, but it would be a trivial logical extension of JsonX (http://publib.boulder.ibm.com/infocenter/wsdatap/v3r8m1/index.jsp?topic=/xi50/convertingbetweenjsonandjsonx06.htm http://publib.boulder.ibm.com/infocenter/wsdatap/v3r8m1/inde...)
- pushingbits 15y agoI'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.