The magazine of the Melbourne PC User Group
SGML/XML/XHTML Resources - Part 6
Major Keary |
 |
Changes to XHTML
The World Wide Web Consortium (W3C) is close to releasing XHTML version 1.1, which may have been formally
promulgated by the time you read this. A number of projects are involved, the most significant of which are
XForms, and the breaking down of the XHTML DTD into modules. Other XML applications, such as XSLT, seem
likely to become part of the XHTML repertoire.
Before you throw up your hands and proclaim that writing Web pages will become too complex, and pine for a
return to simple HTML, XHTML does not have to be difficult. Pages with static content (which can include
images, animation, and text) will not require authors to change their ways all that much. However, HTML's
anything-goes style is coming to an end; XHTML demands discipline. Once you get into the rhythm it will
be just as easy to author Web pages.
For those who create pages that require database connectivity, or other interactive features, XHTML will
provide a range of improved tools. Authors and developers who plan ahead should find their tasks made much
easier.
A Modular Approach
You may have seen references to XHTML Basic; it will be a stripped down DTD (document type definition)
designed primarily for WAP applications. Small devices, such as mobile phones, cannot carry the processing
and memory overheads required for full-scale Web browsers. The answer is an instruction set, so to speak,
that suits the capabilities of small devices.
Basic is one of seventeen proposed modules; the others are: Structure, Hypertext, List, Applet,
Presentation, Edit, BDO (bi-directional algorithm), Forms, Tables, Image, Image Map, Intrinsic Events,
Meta-information, Scripting, Stylesheet, and Link. The idea is that modules can be selected
according to need, thus cutting down the overhead of a one-size-fits-all DTD. Ordinary users will be able to
accept the default DTD.
The modular approach lends itself to customised modules that can be attached to a standard DTD. However,
going modular has its problems; that topic is beyond the scope of this summary, but is discussed in Simon St
Laurent: XML-Elements of Style (McGraw-Hill, ISBN 0-07-212220-X).
XForms
Forms of one kind or another have become an important part of Web programming, but their use is limited. The
W3C is working towards a much more advanced capability, details of which can be found at
http://www.w3.org/TR/2000/WD-xhtml-forms-req-20000329. For commercial applications XForms is an important
project and developers should keep abreast of the proposals.
Two recent books include detailed previews of XHTML 1.1, each with a disclaimer: until XHTML 1.1 is
promulgated the exact nature of the changes will not be known. However, the authors give a good account of
what we can expect, as well as providing new users with excellent XHTML tutorials.
XHTML By Example is a thorough introduction and practical guide that assumes at least a minimal
knowledge of HTML. If you know something of HTML and want to learn XHTML for serious use, this is a very good
step-by-step tutorial. It is also a particularly useful introduction to XML, XSL, XSLT, and XPath.
The author, who is a member of the W3C XHTML Working Group, goes beyond simply telling the reader what to do;
she discusses important issues that have to be grasped if one is to make the best use of available Web
authoring tools. The discussion of the forthcoming modular approach to XHTML is detailed and well
presented.
Ann Navaro: XHTML by Example
ISBN 0-7897-2385-9
Published by QUE, 369 pp.,
RRP $54.95 incl. GST
|
 |
XHTML for Dummies assumes four things: "You can turn
your computer on and off; you know how to use a mouse and keyboard; you want to build your own Web pages for
fun, for profit, or because its your job; . [and] . you already have a working connection to the Internet .".
Some familiarity with HTML would be helpful, but if you are a newcomer to Web authoring and want to learn
XHTML from the ground up, this is a good first step.
A companion CD, set up for use with a browser, contains all the code examples used in the book, lists of all
the mentioned URLs, and some software applications.
Ed Tittel et al.: XHTML for Dummies
ISBN 0-7645-0751-6
Published by IDG, 422 pp. + CD,
RRP $44.95 incl. GST
|
 |
Document Type
Definition
In some of the literature Document Type Definition and Document Type Declaration are used incorrectly. The
abbreviation, DTD, stands for Document Type Definition and should not be used for anything else (at least, in
the context of SGML/XML/XHTML). A Document Type Declaration is just that: a declaration of the DTD with which
a Web page should conform and which looks something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
In HTML the use of a document type declaration is optional, but in XHTML it is necessary and should be the
first line of code. In XHTML 1.0 three DTDs are available:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
The first is known as strict, which means it conforms strictly to the HTML 4.01 standard and doesn't like the
use of deprecated tags.
The second, transitional, accepts deprecated tags and reflects current HTML usage. In short, it is the
safe one to use. The third, frameset, is identical to transitional with one exception: the body
tag, <body>, is replaced by <frameset>.
The Document Type Definition is a subject in its own right. Most users will not need to concern
themselves with its complexities because the three default DTDs are built into current-version browsers.
However, a DTD can be modified in order to create custom elements and tags, or an entirely new DTD can be
created for special purposes. The DTD specifies each-and every-tag and element. Anyone who wants to go beyond
publishing simple, static pages should have some understanding of DTD functions and how they are set up.
Those who want to pursue the subject will find documentation on the W3C website (http://www.w3c.org/); two DTD-specific titles are, St Laurent & Bigger:
Inside XML DTDs, McGraw-Hill; and Megginson: Structuring XML Documents, Prentice Hall. The first
title focuses on DTDs for scientific and technical applications. For serious developers, Walsh and Muellner:
DocBook-The Definitive Guide, O'Reilly, contains the full details of a well-established SGML DTD that
is widely used for technical documents of all kinds.
XSL and XSLT
For all practical purposes the eXtensible Stylesheet Language (XSL) is not presently supported by Web
browsers. In case you have heard that Microsoft IE5 is XSL-enabled, the version offered does not comply with
the W3C standard. A number of articles and white papers on XML and XSL can be found at http://msdn.microsoft.com/xml/.
Cascading Style Sheets (CSS), as used in HTML 4.01, is supported by XHTML. In fact XSL and CSS address
different needs, but there is not space here to expand on that. XHTML by Example discusses the issues in some
depth.
The eXtensible Stylesheet Language: Transformations is an example of the special uses of XSL, but is
not something that ordinary users will be likely to encounter. Its primary function is to transform one XML
document into another, but it can be used to transform the structure of a wide range of documents, including
HTML. In short, XSLT can transform any of the many XML-compliant documents from one application to another.
If a document can be transformed into HTML (and there are many utilities for doing that), then it can be
further transformed by XSLT. This is a tool that Web programmers and developers should learn to use.
An example of transformation given in XSLT Programmers Reference relates to music; there are "at least
three different XML schemas for describing music . all invented with different purposes in mind . MusicML .
is oriented to displaying music notation graphically; ChordML is designed for encoding the harmonic
accompaniment to vocal lyrics, while the much more comprehensive Music Markup Language (MML) . is designed
for serious musicological analysis, embracing Eastern and African as well as Western musical idioms". One
does not have to know too much about music to realise that transforming such data from one to another, or
even into some other format, is just a bit complex. However, XSLT can be used to convert between those three;
to convert from any one of them "into visual music notation by generating the XML-based vector graphics
format, SVG; to play the music on a synthesiser by generating a MIDI file; to transpose the music into a
different key; or to extract the lyrics into HTML or some other XML document.
XSLT Programmers Reference is not for novices, but has been ". written . for practising software
developers who have used a variety of languages in the past and now want to learn how to use XSLT to create
new applications". This is the most thorough coverage presently available and includes a number of case
studies.
Michael Kay: XSLT Programmers Reference
ISBN 1-861003-12-9
Published by Wrox, 777 pp.,
RRP $77.95 incl. GST
|
 |
Reprinted from the February
2001 issue of PC Update, the magazine of Melbourne PC User Group, Australia
|