DREAMWEAVER CS3
User Guide
326
O
ptimizing and debugging code
Find coding errors with the Validator
You can use the Validator in Dreamweaver to quickly locate tag or syntax errors in your code. You can specify the
tag-based languages against which the Validator should check, the specific problems that the Validator should check,
and the types of errors that the Validator should report.
Note:
Validator preferences are ignored when you validate a document that explicitly specifies a doc type.
1
Select Edit > Preferences (Windows) or Dreamweaver > Preferences (Macintosh).
2
Select Validator from the Category list on the left.
3
Select tag libraries to validate against.
You can’t select multiple versions of the same tag library or language; for example, if you select HTML 4.0, you can’t
also select HTML 3.2 or HTML 2.0. Select the earliest version you want to validate against; for example, if a
document contains valid HTML 2.0 code, it will also be valid HTML 4.0 code.
4
Click Options, and set options for those libraries.
5
Select Display options for the types of errors and warnings that you want the Validator report to include.
6
Select items the Validator should check for:
Quotes In Text
Indicates that Dreamweaver should warn you about each use of quotation marks in the text of the
document; you should use the " entity instead of quotation marks in the text of HTML documents.
Entities In Text
Indicates that Dreamweaver should recommend changing certain characters (such as ampersand
(&), less-than (<), and greater-than (>)) to their HTML entity equivalents.
7
Click OK to close the Validator Options dialog box, and click OK again to set the preferences.
See also
“Validate tags” on page 328
Clean up code
You can automatically remove empty tags, combine nested
font
tags, and otherwise improve messy or unreadable
HTML or XHTML code.
For information on how to clean up HTML generated from a Microsoft Word document, see “Open and edit existing
documents” on page 75.
1
Open a document:
•
If the document is in HTML, select Commands > Clean Up HTML.
•
If the document is in XHTML, select Commands > Clean Up XHTML.
For an XHTML document, the Clean Up XHTML command fixes XHTML syntax errors, sets the case of tag
attributes to lowercase, and adds or reports the missing required attributes for a tag in addition to performing the
HTML cleanup operations.
2
In the dialog box that appears, select any of the options, and click OK.
September 4, 2007