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

3. The archx.rnc schema

This section describes the XML schema for the index files created by archx. This schema uses the Relax NG Compact Syntax; see Relax NG Compact Syntax (RNC) for a description of the schema language.

The schema is presented here in “literate programming” style. For more information on literate programming, see A source extractor for lightweight literate programming.

First is a comment block that points back here to the documentation:

archx.rnc
# archx.rnc: Relax NG schema for bird slide archive index.
# For documentation, see:
#    http://www.nmt.edu/~john/slides/archx/
#----------------------------------------------------------------

The goal symbol is archive-index, which represents the index of one entire archive directory (one CD's worth).

archx.rnc
start = archive-index
archive-index = element archive-index
{ image*
}

Each image is described by one image element:

archx.rnc
image = element image
{ attribute cat-no { text },
  attribute high { xsd:positiveInteger },
  attribute wide { xsd:positiveInteger }
}

The attributes are:

cat-no

The image's catalog number. This must match a cat-no attribute in some original element in the birdimages.xml file.

high

The image's height in millimeters, to a precision of 0.1mm.

wide

The image's width in pixels.

Here's a small sample file:

<archive-index>
  <image cat-no="2005-09-05-0022" wide="512" high="462"/>
  <image cat-no="2005-02-18a0005" wide="2018" high="2796"/>
</archive-index>