104
Chapter 7 Using Web Development Languages
Example: Validating against the HTML 4.0 specification
1
In the
Options > Settings > Validation
pane, select HTML 4.0.
2
Click Validator Settings.
3
In the Validator Configuration dialog box, on the Options tab, in the Report box,
select every type of error except CFML Compiler Errors.
4
In the Other box, select the options to check for quotes in text and report special
characters.
Checking for quotes ensures that each quotation mark is followed by another of
the same type (’ or ”). Reporting special characters catches errors like having “&”
in the HTML as opposed to “&”.
5
On the Tags tab, expand the HTML 4.0 node and select the noframes node.
6
In the Tag Options box, select Required in document and click Apply Options.
7
Expand the img node, select the Attributes folder and click Add.
8
In the New Attribute dialog box, type alt and click OK.
9
Select the Required folder, and click Add.
10 In the Add Required Attribute dialog box, type alt and click OK.
The Versions tab is for if I need to extend the tag sets against which I can validate,
and the Values tab is for validating regular expressions. These are unnecessary for
a standard HTML 4.0 document, so this configuration is complete.
11 Click OK.
12 Back in the Settings dialog box, click Apply.
Running the validator
You can run the validator for the current document or for a selected tag.
Validating a tag only checks the contents of the specific tag. For example, it does not
check if a tag has an end tag or if the tag is in the wrong place in the document.
Note
If you validate both CFML and HTML in a single document, the validator cannot
assess the pound sign (#). This is because, in CFML, the single pound is an error and
the double pound is correct; while in HTML, the double pound is an error and the
single pound is correct.
To validate the current document:
1
Select
Tools > Validate Current Document.
The Validation Results pane displays a “No errors or warnings” message or lists
the syntax errors that it found.
2
Double-click an error message to highlight it in the document.
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...