Using the Syntax Checker


    You can use the Syntax Checker across an entire site, or in any of the editors.

To check syntax:

  1. Do one of the following:
    • To check the syntax for all files in a site, open the site.
    • To check syntax for a single page, select it in the Files tab of the Site window, or open the page in any editor.
  2. Choose Edit > Check Syntax, or, if you've opened a page, click the Syntax button Syntax button   in the Highlight palette or in the toolbar of the Source Editor.
  3. Select the DTDs 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 assigned 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 4 Strict) to check compliance with that DTD.
  4. 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.
  5. 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.
  6. 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.
  7. Click OK.
  8. GoLive displays errors and warnings in the Check Syntax Result window, as well as highlighting the errors and warnings in the Source and Outline editors. The Highlight palette also opens and displays the total number of errors and warnings.

  9. Do one of the following:
    • Click Close to close the Check Syntax Result window.
    • Click Create Collection to create a collection of the syntax results in the currently open site. For more information about collections, see Using collections.

To locate and examine errors in your document:

  1. Do one of the following:
    • View the errors in the Check Syntax Result window.
    • Open the Outline Editor. Each error appears next to the element where the error is located in your document. (See Editing source code in the Outline Editor.)
  2. Correct each error, and then check your source code again by choosing Edit > Check Syntax.