3 ms·
Right; it's hard to be both HTML and XML, so you need to use the XHTML serialization of HTML5 if you want use XML (which is what the example document appears to
by jamesbritt 17y ago
Right; it's hard to be both HTML and XML, so you need to use the XHTML serialization of HTML5 if you want use XML (which is what the example document appears to be).
- pbhjpbhj 17y agoI'd heard of the idea of using XML forms (explicit self closing tags) in HTML5 to allow it to be parsed as XML, but only at the start of the week began writing my first HTML5 DTD pages. I'd put my weight behind XHTML2 winning but that sadly seems to look ever less likely. I'd assumed that if I kept my <img /> and <meta />, etc., void tags as is things would work fine .. it looks like they should. But, the whatwg who have many more people and spend many more hours on this tell me "it's not that simple, it won't work" I tend to have to take that on face value - I can't afford to write 40 pages using XHTML style void tags and then have an FF upgrade baulk because some nuance of HTML5 parsing spews at my tags. FWIW.
- jamesbritt 17y agoAs far as I can tell you have a choice of using HTML or XHTML syntax. The "it won't work" thing refers to trying to create what is ostensibly an HTML document but using XML syntax. The kicker with going the XHTML path, though, is the expectation that the document will be served with a particular content-type header meant for XHTML/XML documents. This is no different than what's (supposedly) required for XHTML documents right now, yet very few people use the correct header (even people who chide others for not using XHTML).