Changing the doctype of a document
If you choose File > New Special to create an HTML document, an XHTML document, an MMS, a RealOne Player Document, or a SMIL document, GoLive automatically sets the doctype for you and selects a default DTD. (See Creating special documents.) If you choose File > New Page, GoLive automatically sets the doctype to HTML 4.01 Transitional. You can set or change the doctype after the document has been created, within certain restrictions. For example, you can change the doctype of an HTML document, or you can convert a document from HTML to XHTML and then choose an XHTML doctype. For best results, start by creating the type of special document you want to ultimately deploy. After you choose a doctype from the Doctype menu, GoLive sets the document's doctype by inserting or changing the !DOCTYPE declaration at the beginning of the document's source code. The doctype you set is also selected as the default DTD in the Syntax Checker. (See Checking syntax.)
To set or change the doctype of a document: - In the Layout Editor, display the document window menu.
- Choose Doctype, and then choose a doctype from the menu. The menu is context-sensitive--that is, if you are editing an HTML document, the valid HTML DTDs are available. For an XHTML document, the XHTML DTDs are available, and for any other doctype, the associated DTDs in the Markup tab of Web Settings are available. (See Using the Markup tab.)
Note: If you associate imported DTDs with text or XML files in the Markup tab of Web Settings, those DTDs are also available on the Doctype menu.(See Importing a Document Type Definition (DTD) file.)
To set or change the doctype of multiple files in a site: - Open a site and select files in the Files tab of the Site window (Shift-click to select contiguous files, Ctrl-click to select non-contiguous files).
- Choose Edit > Site Aware Commands > Change Doctype.
- In the Change Doctype dialog box, choose a doctype from the New Doctype menu, and click OK.
To convert the doctype of a document from HTML to XHTML: - Do one of the following:
- To convert a single document, choose Markup from the document window menu in the Layout Editor, and then choose Convert to XHTML. The Convert to XHTML dialog box opens.
- To convert multiple documents, open a site, select files you want to convert (Shift-click to select contiguous files, Ctrl-click to select non-contiguous files), and then choose Edit > Site Aware Commands > Convert to XHTML. The Convert to XHTML dialog box opens.
- To make your converted XHTML document compatible with more browsers, select the following options to set how GoLive converts the document from HTML to XHTML:
- Wrap <style> Content Into CDATA wraps all of the text inside style sheets to prevent GoLive from mistakenly interpreting the special characters in the style element.
- Wrap <script> Content Into CDATA wraps all of the text inside scripts to prevent GoLive from mistakenly interpreting the special characters in the script element.
- Put a Space Character In Front of "/>" converts empty tags such as <empty> to <empty /> instead of <empty/> (no blank space before the slash). This option helps make your document compatible with some browsers that can't handle end tags that have the correct syntax according to standards published by the W3C.
- Remove <meta> Encoding Element removes the meta encoding element from the head section because the starting XML element contains encoding information.
- Remove Encoding Information If It Is UTF-8 removes the encoding information if it is UTF-8, which is the default encoding for XML.
- Remove <?xml?> declaration if encoding is UTF-8 or UTF-16 removes the <?xml?> declaration if the page's encoding is set to UTF-8 or UTF-16. <?xml?> declarations are not required if the document's encoding is set to UTF-8 or UTF-16.
- Use the following options to set how you want GoLive to handle the conversion of the name attribute used in the following elements: a, form, img, and map. The conversion of the name attribute can cause compatibility problems in some browsers. HTML requires the name attribute for functionality, but the XHTML Strict DTD doesn't allow the name attribute in those elements.
- Do Not Touch does not change the name attribute or its value. For example, <form name="formName"> remains <form name="formName"> after conversion.
- Copy To Attribute "ID" copies the name attribute and its value to an ID attribute. For example, <form name="formName"> becomes <form name="formName" ID="formName"> after conversion.
- Convert To Attribute "ID" converts the name attribute to an ID attribute. For example, <form name="formName"> becomes <form ID="formName"> after conversion.
Note: If you select the Do Not Touch option or the Copy To Attribute "ID" option and your document has an XHTML Strict doctype, the Syntax Checker reports an error on the name attribute, but the document works correctly in a browser. If you select the Convert To Attribute "ID" option, and your document has an XHTML Strict doctype, the Syntax Checker doesn't report an error, but the document might not work correctly in a browser. - Click OK.
To convert the doctype of a document from XHTML to HTML: Do one of the following: - To convert a single document, choose Markup from the document window menu in the Layout Editor, and then choose Convert to HTML.
- To convert multiple documents, open a site and select the files you want to convert (Shift-click to select contiguous files, Ctrl-click to select non-contiguous files), and then choose Edit > Site Aware Commands > Convert to HTML.
|