Page 1 of 1

No DOCTYPE in HTML output of Docbook document

Posted: Mon Dec 19, 2005 4:59 pm
by cshare88
When I transform a Docbook document to HTML the resulting file contains no DOCTYPE information. How do I set up the transformation to generate that line?

Posted: Mon Dec 19, 2005 5:35 pm
by sorin_ristache
Hello,

You have two solutions:

- use the DocBook stylesheet for XHTML output which generates a DOCTYPE declaration for XHTML 1.0 Transitional;

- create a simple customization layer for generating the desired DOCTYPE declaration. For example the following customization layer

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="file:/C:/Program Files/Oxygen 6.2/frameworks/docbook/xsl/html/docbook.xsl"/>
<xsl:output doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
</xsl:stylesheet>
generates the DOCTYPE delaration of a HTML 4.01 document.

Regards,
Sorin