Changing the DocType

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

Page.asp

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" "http://www.w3.org/TR/REC-html40/loose.dtd">

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.

Pages.xsl

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:

xmlns="http://www.w3.org/TR/REC-html40/loose.dtd"
xmlns:html=http://www.w3.org/TR/REC-html40/loose.dtd

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

Original:

<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', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd')" />

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', 'http://www.w3.org/TR/REC-html40/loose.dtd')" />

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

Content.xsl

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:

xmlns="http://www.w3.org/TR/REC-html40/loose.dtd"
xmlns:html="http://www.w3.org/TR/REC-html40/loose.dtd"

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