Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the role of xhtml in Html5?

Tags:

html

xhtml

I am reading and hearing conflicting information on this subject. w3c closed XHTML 2.0 working group and asking us to look at XHTML 5 coming out of HTML5. How is this different from XHTML 1.0 or 1.1?

like image 966
Srikar Doddi Avatar asked Dec 09 '22 15:12

Srikar Doddi


2 Answers

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.

like image 107
el.pescado - нет войне Avatar answered Dec 12 '22 05:12

el.pescado - нет войне


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.

like image 27
2ndkauboy Avatar answered Dec 12 '22 05:12

2ndkauboy