Next / Previous / Contents / TCC Help System / NM Tech homepage

5.3. Overall structure of the plan.xml file: The plan.rnc schema

The content of a plan.xml file is described by a schema written in the Relax NG Compact Syntax. For an introduction to this schema notation, see Relax NG Compact Syntax (RNC).

We will use a “lightweight literate programming” (LLP) approach to describe this schema file, plan.rnc. For more information, see the author's LLP page.

The goal symbol or top element of this schema is the plan element:

plan.rnc
start = plan
plan = element plan
{ attribute base-url { xsd:anyURI },
  attribute source-dir { text },
  attribute rcs-version { text }?,
  attribute rcs-date { text }?,
  path-map?,
  page
}

Attributes of the plan element include:

base-url

This required attribute defines the URL of the starting directory. It is necessary so that each page can know its URL.

source-dir

The absolute pathname of the starting directory. This is needed so we can form the absolute pathname of each page. Required.

rcs-version

If you are using RCS source code control, this optional attribute is a good place to put your $Revision$ identifier, so that the current revision number will be filled in every time you check in the file.

rcs-date

If you are using RCS source code control, this optional attribute can hold your $Date$ identifier, so its value can be set to the date when you check in the file.

The content of the plan element consists of an optional path-map element, followed by a required page element. If present, the path-map element contains the definitions of all your topic names. The page element describes the top, starting page of your web; its children are the second-level pages; their children are the third-level pages; and so on, following a strict outline format.

The URI for this schema is:

http://www.nmt.edu/tcc/projects/pystyler3/plan.rnc

Because the plan.xml file can contain regular XHTML markup such as “<tt>”, this file is a mixture of two namespaces: the namespace defined in the plan.rnc file, and the XHTML namespace. It is good practice to define both namespaces in the root element, and to pick a namespace prefix for one or both of the subsidiary namespaces.

So a top-level element might look like this:

<plan xmlns="http://www.nmt.edu/tcc/projects/pystyler3/plan.rnc"
    xmlns:h="http://www.w3.org/1999/xhtml"
    base-url="..." source-dir="...">
  ...
</plan>

The first xmlns attribute says that elements without a namespace qualifier are from the namespace described in the plan.rnc schema. The “xmlns:h” attribute allows you to include XHTML elements by using the “h:” namespace qualifier.