The DTD WebHowTo.dtd provides in principle a subset of the functionality from the DocBook DTD. In practice it isn't like DocBook at all; but it was inspired by DocBook. Basically I just wanted to use XML to generate web-based how-tos that fulfill my needs. So this WebHowTo DTD is the result.
This XSLT stylesheet WebHowTo.xsl is used to generate HTML. To make life a little easier (pun intended :-) I use a Makefile to validate the XML and to generate the HTML. As you can see it invokes xmlproc_val and xalan to accomplish these tasks.
Notice that the xslt file refers to another xslt file: WebHowTo_vars.xsl. This file contains variables that one would typically like to change between documents, such as the CSS style sheet, the author's name, a favicon, etc. for the document to be generated.
The DTD and stylesheets will mutate somewhat as I work my way through my web tree, converting existing HTML to XML. I am learning as I go, and frequently
Here is a table of the files mentioned above, without the HTML markup. You would have to <shift-click> in mozilla to save them locally using Mozilla:
|WebHowTo.dtd||the DTD file|
|WebHowTo.css||the CSS stylesheet|
|Makefile||the makefile to aid HTML generation|
|WebHowTo.xsl||the XSLT stylesheet|
|WebHowTo_vars.xsl||extra XSLT stylesheet|
The <WebHowTo/> element is the root element of this XML document type.
Optional <comment/> elements may precede the main title element. The purpose of the comment elements is add any HTML-style comments to the generated document. They will appear before the first section of the document.
A WebHowTo document must have a <title/> as the first child element.
One or more <section/> elements are required.
An optional <appendices/> element follows the <section/> elements.
The last element must be the <footer/>. Only one is allowed.
Most of the major elements of a WebHowTo are constrained - they may only contain other elements. The <title/> tag may only contain parsed character data.
At a deeper level most of the elements contain a <block/> element, which is described in greater detail in a following section.
A section element must have a <title/> as the first child element.
A <prolog/> element is not required, but if present it must come right after the title element, but before all other section child elements. Only one prolog is allowed per section.
Only <block/> elements are allowed in a <prolog/> element.
Either <sect2/> elements or <block/> elements are next allowed as children of a section element. Zero or more of the same element type are allowed.
A sect2 element must have a <title/> as the first child element.
Either <sect3/> elements or <block/> elements are next allowed as children of a section element. Zero or more of the same element type are allowed.
A sect3 element must have a <title/> as the first child element.
Either <sect4/> elements or <block/> elements are next allowed as children of a section element. Zero or more of the same element type are allowed.
A sect4 element must have a <title/> as the first child element.
Only <block/> elements are allowed after the title element. Zero or more block elements are allowed.
One or more <appendix/> elements are the only valid children of the appendices element.
An appendix element must have a <title/> as the first child element.
Zero or more <block/> elements are the only valid children of the appendix element.
A footer element has <date/> elements only.
All the major elements which contain other elements reduce to the <block/> element. This section describes the block element.
Aside from simple character data, a block element may contain the following elements.
|list||a list-based element|
|table||a tabular element|
<item/>, <def/>, <output/>, <i/>, <b/>, <u/>, <code/>
|item||a member of a list|
|def||a term definition in a definition list|
|output||a text block representing terminal output|
<term/>, <tag/>, <attr/>, <c/>, <f/>, <rpm/>, <url/>, <prompt/>
|term||a term in a definition list|
|tag||delineates a bracketed markup tag|
|attr||designates an attribute|
|c||indicates a program, a command|
|f||indicates a file|
|rpm||indicates an RPM|
|url||provides a URI link|
|prompt||formatted like a command-line prompt|
This is the list of tags referenced in this document:
This is the list of programs referenced in this document:
Document generation: http://penguin.triumf.ca/xml/WebHowTo.html
Number of sections provided: 4