XHTML 5 Resources

XMLmind has developed a robust, self-contained, W3C XML Schema for XHTML 5 which is as faithful to W3C Working Draft 29 March 2012 as an W3C XML Schema can be.

XMLmind has also developed XSLT 2 stylesheets allowing —with the help of the appropriate XSL-FO processor— to convert XHTML 1.0, 1.1 and 5.0 documents to PostScript, PDF, RTF, WordprocessingML, Office Open XML (.docx) and OpenOffice (.odt).

These XSLT 2 stylesheets

The W3C XML Schema for XHTML 5 and the XSLT 2 stylesheets for XHTML 1.0, 1.1 and 5.0 developed by XMLmind are open source software licensed under the terms of the MIT license. This means that you may freely use these resources outside XMLmind products.

Contents of the distribution

xhtml5_resources.README.html
This document.
xhtml5_resources.LICENSE
The MIT license.
xsl/
Contains the XSLT 2 stylesheets allowing to convert XHTML 1.0, 1.1 and 5.0 to XSL-FO. The main stylesheet is fo.xsl.
xsd/
Contains the W3C XML Schema for XHTML 5.

Using the W3C XML schema to validate an XHTML 5 document

Example: validate this document (which is valid XHTML 5) using Xerces2 Java Parser 2.11:

$ java -cp "$XERCES_HOME/xercesSamples.jar:$XERCES_HOME/xercesImpl.jar:$XERCES_HOME/resolver.jar" \
    jaxp.SourceValidator \
    -a xsd/xhtml5.xsd -i xhtml5_resources.README.html

Using the XSLT stylesheets to convert an XHTML 5 document to PDF

The XSLT stylesheets require Saxon 9.3+ in order to work.

Example: convert this document (which is valid XHTML 5) to PDF using Apache FOP:

$ java -jar "$SAXON9_HOME/saxon9he.jar" -xsl:xsl/fo.xsl \
   -s:xhtml5_resources.README.html \
   -o:tmp.fo \
   foProcessor=FOP

$ fop tmp.fo xhtml5_resources.README.pdf

Note that the XSLT stylesheets must be passed a foProcessor parameter specifying which XSL-FO processor is being used. This allows to take advantage of extensions which are specific to the processor or or the contrary to workaround limitations which are specific to the processor.

Support

Please send bug reports to xmleditor-support@xmlmind.com a public, moderated, mailing list. (You don't need to be a list member to post a message.) More information in http://www.xmlmind.com/xmleditor/support.html.

History of changes

1.0.5 (February 18, 2013)

Updated xhtml5.xsd to reflect the specifications contained in W3C Working Draft 25 October 2012.

1.0.4 (January 21, 2013)

Bug fix: the XSL stylesheets now add attribute xml:lang to element fo:root when attribute lang or xml:lang is set on the html root element of the source document. Previously, these stylesheets added a language attribute to element fo:page-sequence but this language attribute possibly contained a combination of a language code and a country code (e.g. "en-US"), which is incorrect.

1.0.3 (September 11, 2012)

Updated xhtml5.xsd to reflect the specifications contained in W3C Working Draft 29 March 2012.

1.0.2 (June 21, 2012)

Bug fix: table attribute rules="all" was not correctly processed.

1.0.1 (April 3, 2012)

Bug fix: the align attribute specified on thead, tfoot, tbody or tr was not inherited by td.

1.0 (March 14, 2012)

First release. Xhtml5.xsd, the W3C XML Schema for XHTML 5 developed by XMLmind corresponds to W3C Working Draft 25 May 2011.