
XML
I'm going to level with you guys. I secretly hate XML a little bit. When I heard about HTML5 and that XHTML was dead (sort of) I was psyched. Then I heard about JSON, and I had a bonafied I-told-you-so moment. (Quick summary so no panic ensues, HTML5 is combining many of the XHTML working groups deliverables into their own; you can still structure/nest tags neatly in HTML5, but it allows more flexibility; if there is one mistake on the page, the page won't fail.)
Then today I got the Flipsider email about the Federal Register in XML and I realized that XML isn't dead, even if aspects of it are going out of style. Not only are there many projects out there already using XML, but new ones will continue to pop up, no matter what w3c or JSON try.
In addition, XML is actually quite good at document mark-up (my fingers hurt just typing this.) I even like the strictness of syntax in XML (close inner tags then outer tags in the right order), but I think I (and, I venture to say, many information professionals) have confused XML as meant for something that it isn't meant for. XML is not a programming language. It is a document mark-up language that can be used to transport documents between programs. XML does not have a good way to deal with images or non-text data objects, although it claims to.
XML needs XSLT or other intermediary languages to be interpreted by browsers or other client-side applications.
JSON
JSON is a JavaScript data-interchange format. It is similar to XML in that it is meant as an envelope for items to be transported between programs, but it is simpler, and it was intended for use with programming languages. This makes it easier for use in browsers.
The best description of the difference between XML and JSON I found was at http://json.org/xml.html, "XML requires translating the structure of the data into a document structure. This mapping can be complicated. JSON structures are based on arrays and records. That is what data is made of. XML structures are based on elements (which can be nested), attributes (which cannot), raw content text, entities, DTDs, and other meta structures."
Both can be used, and XML can be transferred to JSON, the Nature approach is probably the best one.
Basically, I think I have to stop hating XML, but I can be grateful that there is something easier to program widgets with.
I apologize for the acronym party.
Dude, Ramona, thanks for this! I wasn't aware of JSON, but it looks extremely useful. wtg!
ReplyDelete