Is there an XHTML5 (XHTML + HTML5)?

Asked

Viewed 1,112 times

14

XHTML is HTML with strict syntax (must be a valid XML).

I can use it in conjunction with HTML5?

  • 5

    No, because we had two paths: XHTML2 and HTML5, and unfortunately the second one prevailed, because the committees and companies involved thought it was better for anyone to get anything up in the air, instead of making people learn the bare minimum necessary to publish consistent things. Worse is that this thought is "fashionable", even gives some beautiful speeches around.

  • @But worse than that it only makes the situation uglier.

  • 1

    @Anyway it’s good to note, suddenly meets the need of OP. I particularly don’t like not having the advantages that XHTML would have, which is the browser does not show malformed content.

  • Maybe this can help you http://www.standardista.com/html5-v-xhtml5/

4 answers

7

There is no XHTML + HTML5. XHTML was a path taken by W3C to try to restrict the entire Internet code pattern. The idea was for everyone to write valid, semantic code. HTML5, in turn, is a language update initiated by a group of developers linked to companies such as Apple, Google and Firefox.

You can write XHTML syntax (which doesn’t make that much difference) in HTML5 quietly. W3C validator won’t complain about the syntax. But it’s a great practice not to mix the two.

  • 1

    Why not mix the two? I also avoid this, but I don’t really know why.

3

XHTML has a default and is validated based on older HTML, which does not include some new Html5 inputs and some metatag syntaxes, unfortunately still XHTML is based on HTML2, following its syntaxes and validations, what is very important for IDES and Servers to be able to validate their code, different from what is seen today in PHP for example (I developed 8 years in this language), q is that lot of gambiarra and poorly done code. With validation based on a pattern, a more readable code is possible for everyone. We look forward to a JSP definition with HTML5 syntax. Until then it’s up to you with velhro XHTML, CSS and Jquery.

  • "XHTML is HTML2-based"? Do you have any reference to support this statement?

  • Sorry for the confusion, XHTML is based on HTML4.

2

I find it interesting you understand what is specification and implementation.

XHTML 4.x, HTML5 are specifications, are a set of rules that define how HTML should be interpreted by browsers, is something analogous to the cultured standard of the Portuguese language.

Implementation is how actual browsers interpret, which usually differs at one point or another depending on the browser, is analogous to spoken Portuguese.

Historically XHTML didn’t stick, most browsers didn’t care much about the XHTML specification, largely due to some boring Xhtml rules like having to define a doctype with a url that no one remembered, having to close solitary tags like <br> that had to be written as <br /> according to the XHTML specification. For browsers it was more important to make the code people wrote work than to follow the XHTML syrup specification.

Based on this was created HTML5, which is a specification closer than browsers implement, which is what really matters.

It was largely browser pressure to make a functional specification, but specifically a group called WHATWG .

tl;dr: there is no xhtml5.

0

By complementing Erik’s response:

  • W3C closed/dissolved/dismantled the XHTML2 workgroup in 2009. By 2007 they had recognized HTML5 as the next HTML standard. So don’t bother with XHTML2.

  • HTML5 has both regular text/html and application/xhtml+xml p/ serve the page.

https://www.w3.org/2009/06/xhtml-faq.html

Note there on the page:

Regarding the XML serialization of HTML, the HTML 5 Specification includes a Section on XML serialization, as well as a Section on text/html serialization. W3C plans to continue work on Both serializations in the HTML Working Group. Thus, we expect the next Generation XML serialization of HTML to be defined in the HTML 5 Specification. Currently, the HTML 5 Specification refers to this serialization as "XHTML 5"

Yes, there is such an XHTML5. At least as a way to serialize the page defined in a section of the pattern. As the W3C itself says, the text/html is sufficient p/most cases (and what is used today with DOCTYPE html)

If you want to kill the curiosity with a material of the time:

http://www.standardista.com/html5-v-xhtml5/

https://mathiasbynens.be/notes/xhtml5

http://html5doctor.com/html-5-xml-xhtml-5/

http://xmlplease.com/xhtml/xhtml5polyglot/

https://www.ibm.com/developerworks/xml/library/x-think45/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.