0

I have some older xsl transformations that I will modify soon. They generated XHTML code from a home-grown XML format. Since I am touching these XSL files anyway, I am wondering how I will deal with HTML 5 not being XML anymore.

I guess it won't be terrible if I still generate HTML (the browsers will still display it), but is there maybe something that is a better solution? Is there an "XHTML 5" corresponding to HTML 5?

3

I am wondering how I will deal with HTML 5 not being XML anymore.

HTML5, unlike its predecessors, is defined as an abstract document, with three different concrete representations (note, however, that it is not guaranteed that every representation can express every possible abstract document):

  • DOM5, an in-memory object format with a defined API
  • HTML5, a textual serialization, inspired by how browsers actually parsed HTML4 (as opposed to the specification, according to which HTML4 was defined as an application of SGML, which no browser except Avaya and Emacs/w3 ever correctly was able to parse)
  • XHTML5, an application of XML intended as the continuation of XHTML 1.1 (not XHTML2)

The latter one is of course the one that is relevant to you.

Note that there is a common subset that makes a document both valid HTML5 and XHTML5, minus the difference in headers. In particular, the HTML5 serialization explicitly allows (and ignores) an xmlns attribute and certain others, precisely for this purpose.

| improve this answer | |
1

If you can move forward to XSLT 3.0, then you can simply say <xsl:output method="html" version="5"/> to generate HTML5.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.