4 ms·
I've been immersed in the markup world since the SGML days, and even I prefer s-expressions to SGML/XML. But here's the thing: XML is all about agreement. Th
by kjhughes 11y ago
I've been immersed in the markup world since the SGML days, and even I prefer s-expressions to SGML/XML.
But here's the thing: XML is all about agreement. The value is not found at the syntactic level, where needless irregularities exit. The value is that more than a critical mass of agreement formed, and this agreement allowed the development of tools and standards useful across industries. Moreover, the low-level agreement on XML has enabled higher level agreement on vocabularies and grammars in many disparate sectors.
Sure, if you had a clean slate you could improve many parts of the XML standards. Consider, for example, XML Schema (XSD). The irregularities and complexity there are similarly annoying. I'd much rather write RELAX schemas. However, whole sectors have selected XML Schema and developed vocabularies and grammars whose value isn't found at the syntactical level; it's found in the agreement reflected in the decisions over vocabulary and grammar made by disparate groups striving to develop a common exchange mechanism.
Quibbles over syntax miss XML's real merit: XML enables agreement in developing vocabularies and grammars.
Apropos: Here's my Stack Overflow answer to the question of when to use XML attributes vs elements, written in XML for fun: http://stackoverflow.com/a/23133755/290085 http://stackoverflow.com/a/23133755/290085
- tel 11y agoI don't mind the syntax and suppose I agree that consensus syntax is the right syntax. The problem is beneath that: XML's semantics are tremendously large while also being a complete mess. The upshot is that the difficulty of being a compliant adopter---of matching such a large, nebulous, incompletely defined set of inconsistencies---is tremendous and instead there are leagues of partial, massively inconsistent consumers and producers who hammer out successful communication via a list of patches. To some degree this situation was inevitable, but XML exacerbates it and cements the pattern.
- kjhughes 11y agoSemantics has two senses that could apply here. In one sense, XML itself is semantically neutral. The association between elements/attributes names and real world objects is merely suggestive. In another sense (that of semantic analysis found in compiler design), validating XML parsers could be said to be enforcing semantics expressed in schemas. I suppose it is in this sense that your objection applies. In the case of XML Schemas or DTDs, I would have to agree. You might find RELAX NG to be less of a semantic mess given its basis in finite tree automata.
- tel 11y agoA majority of my concerns were resting on XML Schemas and the like—or even OWL (!)—but even recognizing what you mean about XML being semantically neutral it's still... semantically dangerous. The issue at hand where attributes and elements can serve very similar purpose is a great example. In a technical sense XML does not suggest anything about the relative meaning of these two bits, but with near universal acclaim they're used as "metadata" and "child data" whatever the speaker might believe those to mean. In spiritually embracing TIMTOWTDI, XML has created a playing field where semantics are by default ambiguous and have to fight their way out of that disadvantage. In some sense, XML-without-semantics has too much structure and this creates a minefield for laying meaning atop it.