Site logo,

How these pages were made


These pages are written as XML files using some HTML elements but also non-HTML elements to simplify the work and to enable the contents and index pages to be generated automatically. For example, I do not have to remember the details of the header and <head> element of an XHTML page because all of that is generated for me when I write simply

<page id="xyz">
  <css>path_to_a_CSS_file</css> <!-- Only needed if there are page-specific styles -->
  <js>path_to_a_JavaScript_file</js> <!-- Ditto for script -->
  <title>Page title</title> <!-- Also creates h1 header if not given. Used in contents page. -->
  <!-- Then any HTML body content, with some other special elements to help -->

The XML is processed against an XSLT file to generate a set of XHTML files, one per page (xyz.html would be generated for the example above). A detailed explanatory example XML file and my XSLT can be downloaded in a ZIP archive from here (6 kbytes).

Another example of using invented elements to overcome problems and speed up writing is given by special characters. It is a common problem when using XSLT that character entities are hard to control. I solve that by writing <char code="abc"/>. Whatever the string abc is, a template matching char elements in my XSLT generates &abc; in the output XHTML.

The generated XHTML is as semantically structured as possible, with accessibility in mind. I completely banish any rendering tags (such as <font>) or attributes (such as align) from my HTML. All rendering is determined by separate CSS files and any dynamic behaviour is in separate JavaScript files.

Diagrams were drawn in Sun's Star Office, which is Java again, and saved as images. I would prefer to use another XML technique, Scalable Vector Graphics (SVG), but that is not yet sufficiently widespread in client systems.

XML, XSLT, XHTML and SVG are all defined by the World Wide Web Consortium, affectionately known as the W3C. You can read about these techniques on the W3C web site.

I use Xalan for running the XSLT transform. That comes from the Apache XML web site, an amazing source of high quality free software. Xalan is written in Java too.

Next page