2 ms·
Use 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 thi
by mindcrime 15y ago
Use 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 against an XQuery expression, route it to the appropriate place based on that matching, store it in an XML database where I can later locate it using XQuery, and then render it into a web-based activity stream by applying an XSLT transform.
Sure, you could get there from here with JSON as well, but it sure seems more natural using XML.
- Yarnage 15y agoThere are things that seem "natural" when using XML? News to me :)
- rollypolly 15y agoYeah, the XML ecosystem is priceless. XPath, for example, is the one reason a project I'm working on can't switch to JSON.
- mindcrime 15y agoI was about to ask if JSON had an equivalent to XPath / XQuery, but it looks like the answer is "yes." http://stackoverflow.com/questions/8481380/is-there-a-json-equivalent-of-xquery-xpath http://stackoverflow.com/questions/8481380/is-there-a-json-e... That's cool to know, and I might just give it a look. But my perception is still that the supporting ecosystem around XML is more mature and comprehensive, at least for some use-cases.
- rollypolly 15y agoInteresting. All these solutions are javascript-based tho. We need a C-based solution (like libxml2).
- BerislavLopac 15y agoHave you followed the link? Dead. :-(
- derickson 15y agoUsing an XML native NoSQL database is a game changer when consuming XML and producing XML HTTP APIs. A good XQuery engine makes many of the problems people are listing about XML simply go away. I like @mnot's point about providing "excellent client bindings" in common languages.
- mindcrime 15y agoWhat DB do you like for storing and querying XML? I've been using eXistDB lately, but I'd be curious to hear if people are finding something else to be better.