
718
|
Chapter 12: Web and Print Publishing
Including these rst two lines of an XML le, with meaningful values, provides the fol-
lowing three benets:
e character set and encoding are declared, and thus unambiguous. is is manda-•
tory in XML.
e document is unambiguously declared as an XML le. is is mandatory in •
XML.
e DTD that the document uses is unambiguous. e DOCTYPE declaration is not •
mandatory in XML, but W3C recommends its use, even for HTML les.
As pointed out earlier, XML is useful well beyond web pages and is used in dictionaries
and OS-level resources.
The xml:lang attribute
Similar to HMTL’s LANG attribute, XML provides the xml:lang attribute that performs a
near-identical function, and allows tags to be assigned a language attribute.
*
When an
XML tag is associated with data that has a clear language attribute, the
xml:lang attribute
should be used and given an appropriate value.
CGI Programming Examples
ere is much more to the Web than simply static HTML and PDF documents. One can
dynamically provide content through what is known as Common Gateway Interface (CGI)
programming. e most common programming language that drives CGI programs is
Perl. But, virtually any programming language will do.
CGI programming involves interaction between HTML forms and a program that does
something (hopefully) intelligent with data from the forms—a prime example of a ...