<?xml version="1.0" encoding="UTF-8"?>

<!-- The basic design of the DTD for the TeX Catalogue

Copyright (c) 1999 Graham J. Williams

The CATALOGUE has a MAINTAINER which records the email address of the
person maintaining the catalogue, a DATESTAMP to record when it was
last modified, and a LICENSE to indicate that it can not be taken by
someone else and copyrighted.  It is to be freely available under
terms similar to the intent of the FSF GPL. All three attributes must
be provided.

The CATALOGUE consists of a collection of zero or more ENTRYs.

An ENTRY has an ID that is used internally to identify the entry.
Could also serve as a sorting key, although ENTRY->ABOUT->NAME might
be the better one to sort on, since it can be any general name, as
typically what the package is know by (and is not restricted to be an
XML ID, which can not, for example, start with a numeral). The
DATESTAMP attribute records the last time the entry was updated and
the MODIFIER attribute is the email address of the person who updated
it.

An ENTRY consists of at least an ABOUT, but also possibly a
DESCRIPTION and information abuot DISTRIBUTIONs.

The ABOUT element records general information about the package,
including a mandatory CAPTION (at least it probably should be
mandatory, but is not presently).

TODO

    Complete the description of the DTD

-->

<!ELEMENT catalogue (entry)*>
<!ATTLIST catalogue 
  maintainer CDATA #REQUIRED
  datestamp  CDATA #REQUIRED
  license    CDATA #REQUIRED>

<!ELEMENT entry (about, description?, distribution?)>
<!ATTLIST entry 
  id        ID    #REQUIRED
  datestamp CDATA #REQUIRED
  modifier  CDATA #IMPLIED>

<!ELEMENT about        (name, caption, author+, home?, license, version?, xref*)>
<!ELEMENT description  (abstract?, documentation*, platform?)>
<!ELEMENT distribution (ctan?, texlive?, tetex?, miktex?)+>

<!ELEMENT author       (name, email*)>
<!ELEMENT version      ((number , released?) | (released , number?))>

<!ELEMENT license (#PCDATA)>
<!--
An empty LICENSE element consists of the TYPE attribute which indicates
the type of license under which the package is available.  In general,
UNKNOWN and OTHER licenses are specifically excluded from free
distributions. Please refer to CTAN:/help/Catalogue/licenses.html, 
or http://www.act.cmis.csiro.au/gjw/tex/licenses.html, for 
details.

The other attributes record the authority of the license, although 
I haven't made much use of that.

If the TYPE is "other" then the PCDATA of the licence element might
provide further explanation.

-->
<!ATTLIST license 
  type (artistic|bsd|dfsg|gpl|knuth|lgpl|lppl|nocommercial
       |nosell|nosource|other|pd|shareware|unknown) "unknown"
  source    CDATA #IMPLIED
  authority CDATA #IMPLIED
  date      CDATA #IMPLIED>


<!ELEMENT xref (#PCDATA)>
<!ATTLIST xref refid IDREFS #IMPLIED>

<!ELEMENT documentation (#PCDATA)>
<!ATTLIST documentation
  location   (ctan|ftp|http)           "http"
  type       (dvi|html|pdf|ps|unknown) "html"
  compressed (gz|bz2|zip)              #IMPLIED>

<!ELEMENT abstract (#PCDATA|xref|emph)*>
<!ELEMENT emph     (#PCDATA)>
<!ELEMENT ctan     (#PCDATA)>
<!ELEMENT email    (#PCDATA)>
<!ELEMENT home     (#PCDATA)>
<!ELEMENT miktex   (#PCDATA)>
<!ELEMENT name     (#PCDATA)>
<!ELEMENT number   (#PCDATA)>
<!ELEMENT platform (#PCDATA)>
<!ELEMENT released (#PCDATA)>
<!ELEMENT tetex    (#PCDATA)>
<!ELEMENT texlive  (#PCDATA)>
<!ELEMENT caption  (#PCDATA|xref)*>
