Information Technology Reference
In-Depth Information
14
Figure 14.2
Running your
posts
through the
W3C
Validator
at http://
validator.w3.
org can be an
unsettling
experience.
Nearly one third of the errors spotted were the result of pasting in ancient copy from another site.
Back in the day, the <font> tag in HTML was the only way to escape having a website written in
the Courier typewriter typeface, with <font-size> in there to define a bigger or smaller font for
nonheading text. Because this post was about web history, it makes sense that there would be a lot
of those tags in there. Had the blogger paid closer attention to his HTML tab, he might have been
able to clean those old tags while retaining the same look as his subject displayed at the time.
Another one fifth had an interesting category: “document type does not allow element X here;
missing one of Y start-tag.” This is a violation of the XML structure. Here, the tag itself was legal,
just not its location. This is where the outline structure demanded in XML makes itself felt.
In Figure 14.1, we showed you the basic structure of a web page using the DOM. XML also has
rules about what tags can go where. Let's say you have a numbered list describing how to plant
bougainvilleas. Your DTD says you have to have the number first, followed by a period. After that,
you can have a paragraph explaining the step. After the paragraph, you can do one of these things:
Go to the next item in the list.
Include another descriptive paragraph.
Write a note or sidebar with special formatting.
Insert a graphic image.
Search WWH ::




Custom Search