4 ms·
Doesn't this defeat some of the advantages of using XML though? Like Xpath?
by anaphor 13y ago
Doesn't this defeat some of the advantages of using XML though? Like Xpath?
- raverbashing 13y agoUsing XPath is good but it's a small comfort in the bloated and overcomplicated world of XML I don't see any advantage in using XML to be honest
- jbaiter 13y ago> I don't see any advantage in using XML to be honest Well, it's great for what it was intended for: structured documents. I work at a library, where I'm dealing with thousands of digitized books and I haven't yet found a proper non-XML alternative to something like TEI.
- sigzero 13y agoI was going to pipe up on this. XML is for documents. JSON is for data. Sadly, the worlds isn't black and white like that.
- emn13 13y agoI've never understood this criticism. XML is quite simple - perhaps too simple. If you're really offended by needing to repeat an element name in the closing tag... well... that's not exactly a serious criticism is it? I mean, you could make various reasonable criticsms - XML sure isn't perfect. You might say the object model maps to documents, but not so well to typical programming constructs such as unordered hashes or ordered lists of unnamed items. You might complain that its data model is too simple in that it can only easily represent printable text-strings not binary data, numbers, dates etc. You might complain that namespaces are a hassle in many API's. You might complain that the distinction between attributes and elements is odd and somewhat arbitrary. But bloated? You're just ranting.
- arethuza 13y agoXML isn't too bad in itself but, a bit like Java, it appears to be one of the favoured tools for those who wish to build the eldritch abominations of the enteprise software world. I've seen people do terrible mind rotting things with XML (e.g. encoded XML documents as attribute values in other XML documents and nested a few levels deep, using XML documents as keys in databases, using formats that aren't quite valid XML and then there is SOAP....)
- haberman 13y agoI think "bloated" is a reasonable description when a feature that almost no one uses (or even knows the existence of) can DoS an XML parser in 15 lines of code. http://en.wikipedia.org/wiki/Billion_laughs http://en.wikipedia.org/wiki/Billion_laughs And it especially is bloated if you throw in the whole suite of XML-related technologies, such as Schema (you may think that's unfair, but XML advocates frequently point to such technologies as the solution to various deficiencies of pure XML).
- Goladus 13y agoI agree with the sentiment of this post but I believe the parent is specifically referring to "bloat" that comes from XML being "perhaps too simple". For example: <e1> first <e2> second </e2> third </e1> If you're parsing this into a data structure, how you you store "first" and "third"? There are a few different, very similar options. This ambiguity means XML parsers account for this differently and a particular programmer is going to have to sort through the various options to find what he needs (dom/etree/xpath/sax/etc). JSON (mostly) forces the author to decide how it should be parsed before encoding the data. I'd say it's unfair to say XML is bloated, it's reasonable to say that the "world of XML parsing" is bloated and confusing, especially if you're a programmer looking for a data serialization format.
- mbell 13y ago> XML is quite simple - perhaps too simple. I disagree pretty strongly with that statement: http://www.jelks.nu/XML/xmlebnf.txt http://www.jelks.nu/XML/xmlebnf.txt XML's grammar is far from simple.