Using the Syntax Checker
You can use the Syntax Checker in any of the editors.
To check syntax: - In any editor, choose Edit > Check Syntax, or click the Syntax button
in the Highlight palette. - Select one of the following in the compatibility list (upper list box) in the Syntax Checker:
- Well-formedness Only to check your document for compatibility with well-formedness standards, but not for compatibility with a DTD or browser set. For example, the Syntax Checker generates error messages for required closing endtags that are missing, attribute values that are required to be enclosed in brackets, or when an attribute is defined more than once. When checking for well-formedness only, the Syntax Checker doesn't generate error messages for closing end tags that are not required, or for attribute values that are not required to be enclosed in brackets.
- !DOCTYPE to check compliance with the DTD for the doctype declared for the document. To use this option, you must have already specified a doctype for the document. (See Setting the doctype of a document.) The Syntax Checker uses the !DOCTYPE declaration to locate the DTD, which can be on your computer, on a local network, or on the Internet.
Note: If the DTD specified for your document is on the Internet, GoLive checks whether the DTD is already cached. If it is, GoLive uses the cached DTD. If it isn't cached, GoLive displays an alert asking you for permission to access the Internet. If you agree, GoLive downloads the DTD. If you refuse permission, GoLive checks your document for well-formedness, but does not check for compliance with the DTD. The cache is cleared when you quit GoLive. - A particular DTD (such as HTML Strict) to check compliance with that DTD.
- A particular browser set (such as NetScape 2-4 or a custom set) to check compatibility with that browser set and the well-formedness of your document. (See Setting Source preferences.) If any element or attribute in your document is not supported by all of the browsers in the browser set, the Syntax Checker displays an error. When checking syntax for compatibility with a browser set, the Syntax Checker does not check the position of elements relative to other elements.
- If your document contains any custom elements or attributes you added to the Markup tab in Web Settings but are not defined in a DTD, select User Elements in the lower list box in the Syntax Checker.
- If you want to allow any additional elements in your document, select the sets of elements in the lower list box in the Syntax Checker.
- To control what to check for and how the Syntax Checker works, select the following options:
- Warnings checks for syntax warnings. For example, GoLive displays a warning if the value of an attribute is invalid, such as <body bgcolor="redd">. Warnings are much less common than errors.
- Errors checks for syntax errors. The Syntax Checker displays an error if it can identify incorrect HTML syntax, or if your document is not compliant with the specified DTD. For example, the Syntax Checker displays an error if your document contains a start tag without a corresponding end tag. For most problems, the Syntax Checker displays errors.
- Show Alert displays information in a dialog box about syntax errors, such as the number of errors found.
- Show Highlight palette displays the Highlight palette with a list of errors and warnings.
- Click OK. The errors and warnings are highlighted in the editors. If you selected Show Highlight palette, the Highlight palette also opens with a list of errors and warnings.
- To locate and examine the errors in your document, do one of the following:
- Check the list box at the bottom of the Highlight palette to learn more about any errors. To display more of the error text, resize the Highlight palette horizontally. (See Using the Highlight palette.)
- Open the Outline Editor and expand the outline. Each error appears next to the element where the error is located in your document. (See Editing source code in the Outline Editor.)
- Correct each error, and then check your source code again by choosing Edit > Check Syntax or by clicking the Rescan button in the Highlight palette.
|