This paper describes a first attempt to create tools and schema to support the S5 format. S5 - A Simple Standards-Based Slide Show System - is a tool that displays slideshows in web browsers using a combination of JavaScript, CSS, and specific XHTML markup. The markup necessary is specified in prose. This project attempts to create machine-readable schema to aid in authoring and validation of these format, as well as explore issues in formalizing so called "microformat."
S5, written and developed by Eric Meyer, is an impressive application of web technologies that allows XHTML to be used to create slideshows that can be displayed as dynamic presentations in modern web browsers.
From the S5 homepage:
S5 is a slide show format based entirely on XHTML, CSS, and JavaScript. With one file, you can run a complete slide show and have a printer-friendly version as well. The markup used for the slides is very simple, highly semantic, and completely accessible. Anyone with even a smidgen of familiarity with HTML or XHTML can look at the markup and figure out how to adapt it to their particular needs. Anyone familiar with CSS can create their own slide show theme. It's totally simple, and it's totally standards-driven.
While it is true in a strict sense that it is "standards-driven" - S5 XHTML files must be valid XHTML files, the actual markup necessary to create a slideshow is only describe in prose.
The S5 1.1 Reference, while thorough and easy to follow, provides no authoritative way to validate a file as being an S5 1.1 compatible XHTML file. In fact, the specification requires that the document type declaration specify it to be an XHTML strict file. While all S5 1.1 files should be valid XHTML files, the S5 format is stricter than XHTML.
Since the JavaScript that "runs" the slideshow requires certain elements and attributes in a certain order in the XHTML file - processing an invalid file leads to problems. However, it is impossible to validate an S5 file with existing XML tools to help with this problem.
Although S5 files can be authored with XML-award editors, or existing editors with XHTML support, there is no authoring support that is specific to S5. A well designed authoring schema can help with that.
Because the S5 specification uses XHTML, it primarily depends on using class attributes on div elements to add semantics. This essentially allows the creation of new pseudo-elements without redefining the DTD. While this makes it extremely easy to use, it causes problems for schema construction.
While it would be possible to create and XML DTD that would constrain the content model of the body element to, for example, only contain div elements, it would not be possible to specify that certain div elements must have certain class attributes.
The Relax NG schema does allow this sort of contextualized definition and constraints of elements of the same name with its grammar-based tools.
Using the existing XHTML modularization in Relax NG by James Clark as a starting point, many of the constraints specified by S5 could be modeled. (Using Trang, these were converted to the Relax NG compact syntax for ease of use.)
The s5.rnc file is identical to the standard xhtml.rnc except that it includes s5-struct.rnc. See that file for details on the defintions. See the rng directory for the complete schema. (All files not prefaced by s5 are from the original XHTML modularization and are unmodified.)
A serious limitation in the current Relax NG schema for S5 is that it imposes restrictions on order that the S5 specification itself does not.
Although the Relax NG interleave construct allows for the general kind of constraint necessary to specify the presence of elements but not their order, it does not allow multiple elements with the same name. This means, for example, it is impossible to specify that some meta elements with different class attributes are necessary, but their order is not important using interleave.
One solution might entail simply having a content model with arbitrary elements before and after each of the required elements, but I do not think it is possible to do this while still maintaining the constraint, for example, that there must be only one meta element with name attribute of "version" and content attribute of "1.1".
Note that the S5 prose specification is not clear on whether order is significant or not, but the JavaScript does not seem to depend on order for the meta elements.
Some brief time was spent working on tools to convert S5 to an XML format that used explicit element names rather than inflected div elements, and back again.
Although Emacs can support schema-aware editing using Relax NG with the nxml-mode, my editor of choice XEmacs with PSGML-mode, does not. These style sheets allow a more flexible workflow.
Another option is work can be done in a DTD-aware editor validating against the XHTML schema, and then later could be validated further against the Relax NG schema for S5.