What is the role of xhtml in Html5?
I am reading and hearing conflicting information on this subject. w3c closed XHTML 2.0 working group and asking u开发者_开发技巧s to look at XHTML 5 coming out of HTML5. How is this different from XHTML 1.0 or 1.1?
XHTML5 is defined by means of abstract tree-like elements (i.e. by DOM), unlike previous HTML versions, that were defined by tags, which were tied to SGML representation.
By using abstract elements, document tree can have several representations. HTML5 defines two standard serializations: SGML-like (technically not based on SGML) HTML5 and XML-based XHTML5. You could even invent your own serialization format, for example JSON-based.
XHTML5 is semantically equivalent to HTML5 (i.e. have the same sets of elements, attributes and nesting rules), but expressed in different syntax. It is even possible to construct document that conforms to both HTML5 and XHTML5.
HTML5 is not part of SGML but XHTML is prt of XML which is part of SGML. So you can have empty tags within HTML5 but not within XHTML.
You can extend XHTML with any XML structure as long as you provide a DTD for that format. in HTML5 there are only some extesions like SVG, MathML which you can use.
I really liked XHTML because it is like XML but HTML5 has a lot more to offer beside other XML formats. Just google a bit what Google, Mozilla, YouTube etc. has to offer with HTML5 and how much you can do with pure HTML5+CSS3 and without the need of JavaScript.
HTML5 has the option to be XML-compliant or not, as far as requiring strict entities, closing tags, etc. So if a strict XHTML format is important to you (as it is to me), HTML5 allows for that. But the flip side of this is that when consuming HTML5 documents from other services, you cannot necessarily rely on them to be strict like you could with XHTML.
The best we can do is encourage others to follow the stricter format by adhering to it ourselves and evangelizing it. IMO it helps far more than it hurts.
HTML5 is HTML 4 with some tags added, some tags taken away, a different doctype, and generally, a bunch of new stuff.
XHTML 1 is just HTML 4 with XML-style syntax.
XHTML5 is just HTML5 with XML-style syntax.
(I may be glossing over some XML details there.)
精彩评论