4 ms·
XML was introduced as a simplified SGML subset to base new versions of HTML (XHTML) and other web vocabularies (SVG, MathML) on, but that failed and HTML5 still
by tannhaeuser 5y ago
XML was introduced as a simplified SGML subset to base new versions of HTML (XHTML) and other web vocabularies (SVG, MathML) on, but that failed and HTML5 still continues to use tag inference, shortforms, and other SGML features that didn't make it into XML. It wasn't conceived as a payload format for web services.
- Ygg2 5y agoThere was a desire to do similar for XML. See XML5 than Anne van Kestren worked on. https://annevankesteren.nl/2007/10/xml5 https://annevankesteren.nl/2007/10/xml5 I wrote a parser for it, but it never got traction. I might have to rewrite it again.
- skissane 5y agoPersonally I prefer Tim Bray's XML-SW to Anne van Kestren's XML5: http://www.textuality.com/xml/xmlSW.html http://www.textuality.com/xml/xmlSW.html XML-SW drops the internal DTD subset entirely, including entity declarations; this means it doesn't support named entity references except for the predefined ones (apos, quot, gt, lt, amp). I think DTDs are one of the ugliest things in XML (and also a well-known source of security vulnerabilities), and it is great that XML-SW (unlike XML5) mostly kills them. I'm also not sold on the whole "HTML-style error-recovery" idea in XML5. In my mind, the syntactic strictness of XML is a virtue not a vice. I'd support killing processing instructions as well. They are rarely used, and XML namespaces could be used as a replacement.
- AlbertoGP 5y agoI agree with what you wrote except for processing instructions: I’m using them in an XML tool I’m developing for my own use, and while I could devise ways to encode them in other ways by abusing other syntax such as namespaces or (ugh!) comments, I prefer to have them available, indeed to be used sparingly.
- Ygg2 5y ago> I'm also not sold on the whole "HTML-style error-recovery" Having used and written a parser for a similar recoverable localization language (https://projectfluent.org/ https://projectfluent.org/) I'm sold on it. It makes a lot of things easier. It's kinda like adding trailing comma to lists. It's both boon when writing lists by hand and generating it via code. > I think DTDs are one of the ugliest things in XML (and also a well-known source of security vulnerabilities), and it is great that XML-SW (unlike XML5) mostly kills them. Hm, that's strange. I'm pretty sure XML5 killed DTD outright, other than having a doctype definition. Perhaps the spec was outdated a bit. XML5 had a few big ideas: - Ending DTD - Unquoted XML attribs <elem atr1=value> - Error recovery / arbitrary nesting which is similar to HTML <a><b></a></b> // Became <a><b></a> <b/>
- skissane 5y ago> Hm, that's strange. I'm pretty sure XML5 killed DTD outright, other than having a doctype definition. Perhaps the spec was outdated a bit. I'm just going by what is at https://annevankesteren.nl/2007/10/xml5 https://annevankesteren.nl/2007/10/xml5 which gives the impression that <!ENTITY> declarations are still allowed.
- Ygg2 5y agoThere was a full specification that had more details. It didn't parse <!ENTITY> and similar declarations but treated it as just a dumb string.
- tannhaeuser 5y ago> DTDs are one of the ugliest thing ... not sold on the whole "HTML-style error-recovery" I think there might be a misconception here. HTML5 does have some ad-hoc rules around script, style, and noscript elements, but the vast majority of tag inference it does is straight from SGML, from which both HTML and XML are derived. Tag inference in SGML is driven by (parent) element content models and per-element tag omission indicators. For example, a minimal HTML doc can look as simple as <title>XYZ</title> <p>body text and SGML and HTML infer omitted tags to arrive at <html> <head> <title>XYZ</title> </head> <body> <p>body text</p> </body> </html> The concept of hierarchically structuring a partially tagged text document, possibly with custom Wiki syntax a la markdown, is pretty fundamental to SGML-style angle-bracket markup, and also required to unambiguously assign an address (path) to every node such that it can be styled using eg CSS. Since it requires declarations or a hard-coded vocabulary, it'd be difficult to remove DTDs/element declarations. SGML is formalized in ISO 8879:1986, and there's absolutely nothing vague or speculative about the kind of tag inference it does. It's just that most people don't seem to know SGML and come up with ad-hoc XML extensions that can't be taken seriously without reference and alignment within the greater SGML context when XML itself is specified as a proper SGML subset. It's interesting that you'd be willing to trade processing instructions for XML namespaces. Most experts, including the article's author, seem to agree that namespaces and XML Schema are the worst XML offenders, taking the just gained simplicity of XML away on the spot.
- johncowan 5y agoYou might want to look at MicroXML <https://dvcs.w3.org/hg/microxml/raw-file/tip/spec/microxml.html https://dvcs.w3.org/hg/microxml/raw-file/tip/spec/microxml.h...> then. No XML declaration, no DTDs, no PIs, no CDATA sections, no cruft.
- TedDoesntTalk 5y agoMay not have been conceived that way, but it became that. XML Schemas were the End of its simplicity.