Hacker News new | ask | show | jobs
by bcoates 4940 days ago
The lack of user-defined tags and attributes (ignoring data-* for a minute because it's different) is what makes HTML such a more pleasant document/markup language than XML.

XML schemas are hard because allowing people to define an ad-hoc ordered hierarchical parsing structure is hard, so most people don't do the schema part (or ignore the schema in the real world) resulting in ambiguity in the rules about what sort of constructs are allowed in the document or what they mean, resulting in XML formats that aren't really interchangeable.

HTML5 relieves this by having only one markup format that's actually specified with a real common understanding instead of a multitude of formal and informal markups. Evidence that the world needs more than one markup format is thin on the ground, what most people need is the ability to locally distinguish between and identify things, and class and id are complete and minimal for that job.

1 comments

the lack of being able to extend or define my own tags and attributes feels like a reduction in freedom to me ... but I guess it depends on your perspective. If you feel comfortable with browser companies and a small handful of ppl defining a rigid vocabulary for the world to use, that is your option; me ... I don't feel comfortable with that situation.

XML schemas are hard ... the xml suite of technologies certainly did not get it right the first time around, but slowly those 'hard' technoloiges get eaiser to use (either because of tooling or in XML Schema case we now have v1.1 with things like assertions that make validation a lot more useful and easier). In the meantime, I am certain that we will see every XML technology eventually will get regenerated and replicated within the JSON stack of tech.

Lastly, I agree that having a sanctioned vocabulary called HTML5 is a 'good thing' ... however saying that the world only needs one markup format is plainly incorrect, its akin to saying we only need a single spoken language; sure a lingua franca would make life (and processes) a magnitude simpler but hoping for this situation to actually occur is a real 'pipe' dream.

IMO, if a 'fallacies of data' type edict was to be handed down, then 'planning for homogeneity (lingu franca)' would be in the top 7.