Hacker News new | ask | show | jobs
by xienze 4224 days ago
> We don't need namespaces in HTML (or in XML for that matter, but that's a different story).

Bzzt, wrong. How would you propose we allow other document types to be embedded in HTML (like SVG)? Just hope the tag names never collide?

2 comments

The HTML5 way is to use specialized HTML tags, where everything inside is treated as the other language:

https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg

https://developer.mozilla.org/en-US/docs/Web/MathML/Element/...

Yes, this is less flexible than XML namespaces. You couldn't do something like XLinks.

I'm not the OP, but 'Bzzt, wrong' is rude, and not how people communicate on HN.

A default namespace of 'html', and explicit namespaces for is reasonable. But <html:a> instead of <a> is ridiculous and few people who currently create content for the web will ever use it.