HTML and CSS Reference
In-Depth Information
Validating Under XHTML Transitional
In the last session, you converted Tom's Web page document from HTML format into
XHTML format. By adding the DOCTYPE declaration and XML namespace, you can test
whether the document is well formed and valid. To test the document, you must submit
the file to an XML parser that will generate a report listing any errors in the document.
Several parsers are available on the Web. You'll use the one hosted on the W3C Web site.
To access the W3C validator page:
◗
◗
2.
Click the
Validate by File
Upload
tab in the Web page.
Trouble?
Depending on the current format of the validator page, it might not
exactly match the figures and screen shots in this session. Use whatever buttons
or forms exist in the Web page.
◗
3.
Click the
Browse
or
Choose File
button, and then locate the
works.htm
file from
the tutorial.09\tutorial folder included with your Data Files.
◗
4.
Select the file, and then click the
Open
or
Choose
button. The filename and path
will be displayed in the File input box, as shown in Figure 9-15.
figure 9-15
selecting a file for validation
◗
5.
Click the
Check
button. The validator reports several errors in the file, as shown in
Figure 9-16.
You can test a different
DTD in the validator page
without editing the file by
clicking the More Options
link, and then select-
ing the DTD from the
Document Type list box.