Changing the DocType

To change the Doctype in the Dynamic HTML output format, you must create a format override by modifying 3 files:


If your desired doctype is html 4.0 transitional, you would modify the declaration at the top of the file to look like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">

Additionally, you can modify the html tag by removing the xml:lang="en" and lang="en" attributes, as these are not required and are not valid in this doctype.


Both the default and html namespaces need to be updated for our new doctype. These are right at the top. Here’s what they might look like, after modification:


Towards the bottom of the page, we also need to modify some settings. These are parameters of wwexsldoc, which is similar to exsl:document


<xsl:variable name="VarWriteResult" select="wwexsldoc:Document($VarResult, $ParamSplit/@path,
wwprojext:GetFormatSetting('encoding', 'utf-8'), 'xhtml', '1.0', 'yes', 'no', 'no',
 '-//W3C//DTD XHTML 1.0 Transitional//EN', '')" />

After our changes:

<xsl:variable name="VarWriteResult" select="wwexsldoc:Document($VarResult, $ParamSplit/@path,
wwprojext:GetFormatSetting('encoding', 'utf-8'), 'html', '4.0', 'yes', 'no', 'no',
 '-//W3C//DTD HTML 4.0 Transitional//EN', '')" />

You can see that we changed the method from xhtml to html, as well as the version and other parameters.


All we need to do here is change the same namespace declarations as we did in Pages.xsl. The top of the file should look like this:


HelpCenter/Tips/ChangingDocType (last edited 2008-02-13 06:18:28 by localhost)