-1

Please explain, when we use XLST1.0, what's key difference between any HTML validation mode: HTML 4.01, HTML5, XHTML 1.1, XHTML 1.0 Frameset, XHTML 1.0 Transitional, XHMLT5?

What features may be present when used transformation on Client or on Server side?

Is there any difference when working with various encodings or various Browser engines?

timnavigate
  • 741
  • 4
  • 12
  • 23

1 Answers1

1

As for XSLT 1, if you want to generate HTML to be processed in a browser as text/html, use xsl:output method="html" and create your HTML elements in no namespace.

If you know you can or want restrict yourself to HTML 4.01 then you can use one of the HTML 4.01 document types in the xsl:output declaration for doctype-system (and additionally the adequate doctype-public if needed), if you want to produce HTML5 then in the XSLT use xsl:output method="html" doctype-system="about:legacy-doctype".

That way your XSLT should generate HTML parseable by the modern browser's HTML soup parsers or HTML5 parsers.

Unless you know you want to serve XHTML to be parsed and processed by browsers as application/xml or application/xhtml+xml I wouldn't recommend trying to use XSLT 1 to produce XHTML.

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
  • Thanks for the "about:legacy-doctype" in html5 contex. I also found a description about that issue https://www.w3.org/html/wg/tracker/issues/54. – timnavigate Jun 09 '20 at 11:02