5 ms·
XML is parallel to HTML, not a generalization. Valid HTML is not a subset of XML. We tried making HTML a subset of XML, with XHTML, and it was probably the big
by kedean 10y ago
XML is parallel to HTML, not a generalization. Valid HTML is not a subset of XML.
We tried making HTML a subset of XML, with XHTML, and it was probably the biggest language standardization failure of all time. XML's only good applications are in publishing non-editable feeds and data. When human-editability is required, it's just too strict for the world.
- tannhaeuser 10y agoWith "we" do you mean yourself personally, or rather as in "we, the markup community"? It's true that XHTML didn't came to be, but that's no reason to give up on structuring web content alltogether. A lot of workflows now are HTML-centric, and the used vocabularies are subsets/specializations/customizations of HTML. That's one area where SGML shines IMHO.
- kedean 10y agoStructuring is great, I agree. I meant specifically that the web community's attempt at applying XML principles to HTML was a failure. I believe that the reason is simply that it was structured in the wrong way. It focused more on how you format text than how you structure what the markup is representing. I think the semantic web is the right direction, where structuring is on the onus of the writer.
- tannhaeuser 10y agoSemantic markup for the web was on the roadmap back when XHTML was worked on, but I'm not sure it ever had a chance of adoption because the use cases for the web were (and are) infinite. Semantic web (RDFa), OTOH, can assert logical properties for arbitrary pieces of markup text; in particular, it's not necessary to use a "semantic" markup style (such as eg. DocBook). On the conference, Steven Pemberton, who is such an inspiring guy to meet, and also of ABC (Python's precursor) fame, gave a talk worth watching on YouTube. He was involved in XHTML on behalf of W3C.
- dragonwriter 10y ago> XML is parallel to HTML, not a generalization. I was using "generalization" in a process rather than analytical sense, in that XML was inspired by and intended to be more general in application compared to HTML.
- Mikhail_Edoshin 10y agoHow is it too strict?
- tannhaeuser 10y agoI'm guessing kedean meant that XML doesn't do tag inference the way SGML/HTML does, insists on quoted attributes, has verbose namespace bindings greeting you at the begin of the document, needs ampersands and other characters as character entity references, hasn't Wiki syntaxes (eg. markdown) like SGML has, etc.
- Mikhail_Edoshin 10y agoAll this "XML is too strict" and other XML FUD seems like a very strange irrational mind virus to me. XML has only five special symbols (two angle brackets, ampersand, and two quotes), and about as many syntax rules as is necessary to write a deterministic parser with one-symbol lookahead. JSON is less well designed in this aspect (mostly because it was never meant to be a data-exchange format); for example, it requires separators between elements and this is more cumbersome for data generators than self-contained XML elements. We already have a not-too-strict programming language JavaScript and now we have to accompany it with JavaScript: the good parts and You don't know JavaScript N-volume series and remember a curious difference between "return <EOL> {..." and "return { <EOL>...". I don't think being too forgiving is such a good idea. Edit: punctuation.
- tannhaeuser 10y agoMikhail I've got nothing against XML and have done a ton of apps using it. Going back to XML's beautiful big sister SGML (please forgive me this metaphor) is very much about keeping to use markup tech for web sites (where XML isn't practical for HTML5). In fact, SGML gives you a formal way to parse HTML into XHTML and thus into XML-based processing pipelines.
- kedean 10y agoYou misread my point. I wasn't complaining about the strictness, I was stating that it was the reason nobody willingly writes XML or XHTML by hand. The problem with strictness is that the world is lazy, and HTML is meant for a much wider set of people than your average general-purpose programming language. That wide group of people may do anything with their markup, and a language that accounts for that will be more successful than one that does not, plain and simple. XML is just fine as a data-interchange format, and I'm fine with it there (though I personally prefer JSON anywhere that it'll fit). It's when humans are introduced into the equation that XML and it's derivatives fall over.