Information Technology Reference
In-Depth Information
IV
To see what a DTD looks like, go to www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.
dtd. This is the Strict XHTML 1.0 type definition. Every WordPress page should refer to this
site, and should validate to that standard. Using the WordPress visual editor makes this, well,
automattic. (Sorry for the awful pun.) If you use another HTML editor or web authoring tool, you
should be able to specify the DTD or DOCTYPE using a project setting or menu item. Check the
documentation for your tool.
On a technical level, WordPress blog pages are a terrific example of Extensible Hypertext Markup
Language (XHTML). This W3C standard combines standard HTML pages with style sheets and
scripting. XHTML offers visitors a dynamic experience, while offering developers a way to quickly
create and edit the look and feel of a site with minimal effort.
The XHTML 1.0 standard was created by the W3C to serve as
a bridge between today's web, coded in HTML, and tomor-
row's web, to be coded in XML. With the introduction of
HTML 5 to replace both the existing HTML and XHTML stan-
dards, that bridge might be standing in place, unused, for a
very long time.
XHTML takes advantage of the DOM. This standard came
about after different browsers used different methods to orga-
nize and display HTML pages. The two dominant browser
companies, Microsoft and Netscape, fought for market share
using proprietary scripting languages and tags that only their
browser understood and could process. Designers, in turn,
had to create pages that looked best in one browser or
another. The W3C created the recommendation for DOM Level 1 in 1998 to provide access to each
and every part of an XML document, including comments and processing instructions. It was meant
to work for any programming language that could parse and manipulate XML documents.
Essentially, the DOM describes a web page as a tree, with each tag serving as a leaf on the tree, as
shown in Figure 14.1. Here you have a page identified through the HTML tag. Every HTML page
must have a <head> section and a <body> section. The <head> includes the page title tag and title
text. The <body> , in this case, has a single heading tagged <h1> , with text for that heading and a
link. The link is composed of the <a> anchor tag and the <href=> tag signifying a hypertext refer-
ence outside the page.
With the DOM, theoretically, scripting languages like PHP and JavaScript should be able to access
and change properties and content of each item (called a node) in this tree. Until fairly recently, all
browsers (especially Internet Explorer) had inconsistent support for the features of the DOM. This
has changed with the latest set of browser revisions. Internet Explorer 7 and 8, Firefox 3.x (and any
other browser based on the Gecko rendering engine), and Opera 8 and up have better DOM sup-
port. The battle for web standards is moving forward!
note
It's a small point, but one worth
noting in our standards discussion:
In XHTML (and XML), tags are in
lowercase letters. Many HTML edi-
tors still create tags with ALL CAPS,
such as <HREF=> and <BODY> .
Check your authoring tool's set-
tings to force it to use lowercase
tags. The WordPress editor, of
course, takes care of this for you.
Search WWH ::




Custom Search