<!--
     DTD for the Web Site Description Language
     Version: 0.7.6
     Author: G. Wade Johnson
     Copyright 2000-2002, by G. Wade Johnson
       Released under the Perl Artistic License.
-->
<!-- Entities: attribute values -->
<!ENTITY  % fileref   "CDATA">
<!ENTITY  % url       "CDATA">
<!ENTITY  % rngnumber "CDATA">
<!ENTITY  % email     "CDATA">
<!ENTITY  % mimetype  "CDATA">
<!ENTITY  % linktypes "(absolute|relative)">
<!ENTITY  % fileclasses   "(other|applet|archive|audio|binary|
                            document|image|plugin|script|source|
                            text|video)">
<!ENTITY  % nameclasses   "(initial|given|family|middle|number|
                            nickname)">
<!ENTITY  % loclasses     "(pll|skeleton)">
<!ENTITY  % codeclasses   "(routine|begin|end)">
<!ENTITY  % boolexpr; "CDATA">

<!-- Entities: attributes -->
<!ENTITY  % root     "root      %url;      #REQUIRED">
<!ENTITY  % copyref  "copyref   IDREF      #IMPLIED">
<!ENTITY  % styleref "styleref  IDREFS     #IMPLIED">
<!ENTITY  % include  "include   %fileref;  #IMPLIED">
<!ENTITY  % codeclass "class    %codeclasses;  'routine'">
<!ENTITY  % layoutref "layoutref IDREF     #IMPLIED">
<!ENTITY  % bodyref   "bodyref   IDREF     #IMPLIED">
<!ENTITY  % dest      "dest     %fileref;  #IMPLIED">
<!ENTITY  % src       "src      %fileref;  #IMPLIED">

<!-- Entities: content values -->
<!ENTITY  % rawtext           "#PCDATA">
<!ENTITY  % styledtext        "#PCDATA">
<!ENTITY  % source.code       "#PCDATA">

<!ENTITY  % person            "honorific?, name+, degree*"
<!ENTITY  % contact.content   "descr?,((%person;)|institution)">

<!ENTITY  % nav.item          "group|page|pageref|subpage|fpage|
                               file|website">

<!ENTITY  % cond              "(if|choose)">

<!ENTITY  % siteinfo.content 
     "(server|directory|contact|copyright|text|header|footer|
       layout|body|%cond)*">

<!ENTITY  % page.content      "(%cond;|prop)*">

<!ENTITY  % stylesheet.content   "#PCDATA">

<!-- Element definitions -->

<!-- website: describes an entire site. -->
<!ELEMENT  website  (siteinfo?,navigation+,resources?,code*)>
<!ATTLIST  website
              id        ID          #REQUIRED
              %include;
              %src;
              %dest;
              %root;
              main      IDREF       #REQUIRED
              title     CDATA       #IMPLIED
              keywords  CDATA       #IMPLIED
              description CDATA     #IMPLIED
              %styleref;
              linktype  %linktypes; "relative"
              %layoutref;
              %bodyref;
              %copyref;>

<!-- navigation: describes the navigation for a website -->
<!ELEMENT navigation  ((%nav.item;|%cond;)*)>
<!ATTLIST navigation
              id        ID         #IMPLIED
              %include;>

<!-- resources: list of non-navigational items on a website -->
<!ELEMENT resources  ((stylesheet|set|page|file|fpage|subpage|
                       %cond;)*)>
<!ATTLIST resources
              %include;>

<!-- set: a grouping of resources that share common
     characteristics for instance a directory
-->
<!ELEMENT set  ((stylesheet|set|page|file|fpage|subpage|
                 %cond;)*)>
<!ATTLIST set
              id        ID         #IMPLIED
              %include;
              %dest;
              %src;
              root      %url;      #IMPLIED>

<!-- siteinfo: meta-data for the site -->
<!ELEMENT  siteinfo  %siteinfo.content;>
<!ATTLIST  siteinfo
              id        ID         #IMPLIED
              %include;	
              ref       IDREF      #IMPLIED>

<!-- group: a group of pages. equivalent to a section in many
     sites. -->
<!ELEMENT  group   ((%nav.item;|%cond;)+)>
<!ATTLIST  group   
              id        ID         #IMPLIED
              %include;	
              %dest;
              root      %url;      #IMPLIED
              main      IDREF      #IMPLIED
              href      %url;      #IMPLIED
              title     CDATA      #IMPLIED
              keywords  CDATA      #IMPLIED
              description CDATA    #IMPLIED
              %layoutref;
              %bodyref;
              %styleref;
              %copyref;>

<!-- page: a page to be built by this system. -->
<!ELEMENT  page  %page.content;>
<!ATTLIST  page
              title     CDATA      #REQUIRED
              %src;
              %dest;
              href      %url;      #IMPLIED
              id        ID         #IMPLIED
              keywords  CDATA      #IMPLIED
              description CDATA    #IMPLIED
              content   %fileref;  #IMPLIED
              %layoutref;
              %bodyref;
              %styleref;
              %copyref;>

<!-- prop: a property of the page. These properties contain
     small pieces of information that may be used in the
     construction of a page.
-->
<!ELEMENT  prop  EMPTY>
<!ELEMENT  prop
              name      NMTOKEN    #REQUIRED
              value     CDATA      #REQUIRED>

<!-- pageref: a reference to a page elsewhere in the web site.
     This element is needed because many sites are not trees,
     they are actually graphs.
-->
<!ELEMENT  pageref  EMPTY>
<!ATTLIST  pageref
              ref       IDREF      #REQUIRED
              fragment  NMTOKEN    #IMPLIED
              title     CDATA      #IMPLIED>

<!-- subpage: a reference to a location/fragment of another
     page.
-->
<!ELEMENT  subpage  EMPTY>
<!ATTLIST  subpage
              title     CDATA      #REQUIRED
              href      %url;      #IMPLIED
              fragment  NMTOKEN    #REQUIRED
              id        ID         #IMPLIED>

<!-- fpage: a "foreign page" which includes offsite links as
     well as local links to pages not built with this system.
-->
<!ELEMENT  fpage  EMPTY>
<!ATTLIST  fpage
              title     CDATA      #REQUIRED
              href      %url;      #REQUIRED
              fragment  NMTOKEN    #IMPLIED
              id        ID         #IMPLIED>

<!-- file: a non-html file linked on the system. This item
     describes files like downloadables, PDF files, images, etc.
     Anything that we may wish to manage in this system but is
     not created by the system.
-->
<!ELEMENT  file  EMPTY>
<!ATTLIST  file
              id        ID         #IMPLIED
              title     CDATA      #IMPLIED
              %src;
              %dest;
              href      %url;      #REQUIRED
              class  %fileclasses; #IMPLIED
              type      %mimetype; #IMPLIED
              nav       (yes|no)   "yes">


<!-- server: define a logical name for a server/machine on the
     web. -->
<!ELEMENT  server   EMPTY>
<!ATTLIST  server
              id        ID         #REQUIRED
              name      NMTOKEN    #REQUIRED
              class     CDATA      #IMPLIED>
<!-- some server classes: main, image, database, search, ad -->

<!-- directory: define a relative or absolute directory in the
     site. -->
<!ELEMENT  directory  EMPTY>
<!ATTLIST  directory
              id        ID         #REQUIRED
              name      %fileref;  #REQUIRED
              class     CDATA      #IMPLIED>
  <!-- some directory classes: image, database, stylesheet,
       include, applet, script
  -->

<!-- contact: information about a person or organization
     associated with the site.
-->
<!ELEMENT   contact   (%contact.content;)>
<!ATTLIST   contact
               id       ID         #REQUIRED
               href     %url;      #IMPLIED
               email    %email;    #IMPLIED>

<!-- descr: description of a contact -->
<!ELEMENT   descr       %styledtext;>

<!-- portions of a name -->
<!ELEMENT honorific    %rawtext;>
<!ELEMENT name         %rawtext;>
<!ATTLIST name
               class   %nameclasses; #IMPLIED>

<!ELEMENT degree       %rawtext;>
<!ELEMENT institution  %rawtext;>

<!-- copyright: copyright information for a site or page -->
<!ELEMENT   copyright  %rawtext;>
<!ATTLIST   copyright
               id       ID             #REQUIRED
               year     %rngnumber;    #IMPLIED
               owner    IDREFS         #IMPLIED
	       style	(default|copy) 'default'>

<!-- text: definition of boilerplate text that may be used on
     the site. -->
<!ELEMENT   text       %styledtext;>
<!ATTLIST   text
               id       ID         #REQUIRED
               class    CDATA      #IMPLIED
               %include;>
  <!-- some text classes: disclaimer, message, -->
  <!-- if "include" is specified, read from there and ignore
       content. Should having content with src specified be an
       error?? -->

<!-- header: definition of header text that may be used on the
     site. -->
<!ELEMENT   header     %styledtext;>
<!ATTLIST   header
               id       ID         #REQUIRED
               %include;>
<!-- if "include" is specified, read from there and ignore
     content. Should having content with src specified be an
     error??
-->

<!-- footer: definition of header text that may be used on the
     site. -->
<!ELEMENT   footer     %styledtext;>
<!ATTLIST   footer
               id       ID         #REQUIRED
               %include;>
<!-- if "include" is specified, read from there and ignore
     content. Should having content with src specified be an
     error??
-->

<!-- stylesheet: definition of style information for a site.
 -->
<!ELEMENT   stylesheet    %stylesheet.content;>
               id       ID         #REQUIRED
               type     %mimetype; #REQUIRED
               %src;
               %dest;
               href     %url;      #IMPLIED>
<!-- if "href" specified, build a link. if content, build a
     style element and include inline. (What do we do about both?)
-->

<!-- layout: associates a name with a layout file. This file
     describes the layout of particular web pages. -->
<!ELEMENT   layout        EMPTY>
<!ATTLIST   layout
               id       ID          #REQUIRED
               file     %fileref;   #REQUIRED
               class    %loclasses; "pll">

<!-- code: container for code to be used in the construction of
     the website.
-->
<!ELEMENT   code    %source.code;>
<!ATTLIST   code
               id      ID         #REQUIRED
               %codeclass;
               %include;>

<!-- cover the full list of attributes from the HTML body tag
-->
<!ELEMENT   body    EMPTY>
<!ATTLIST   body
               id      ID         #REQUIRED
               class      CDATA   #IMPLIED
               style      CDATA   #IMPLIED
               title      CDATA   #IMPLIED
               lang       NAME    #IMPLIED
               dir      (ltr|rtl) #IMPLIED
               onclick    CDATA   #IMPLIED
               ondblclick  CDATA  #IMPLIED
               onmousedown CDATA  #IMPLIED
               onmouseup   CDATA  #IMPLIED
               onmouseover CDATA  #IMPLIED
               onmousemove CDATA  #IMPLIED
               onmouseout  CDATA  #IMPLIED
               onkeypress  CDATA  #IMPLIED
               onkeydown   CDATA  #IMPLIED
               onkeyup    CDATA   #IMPLIED
               onload     CDATA   #IMPLIED
               onunload   CDATA   #IMPLIED
               background CDATA   #IMPLIED
               bgcolor    CDATA   #IMPLIED
               text       CDATA   #IMPLIED
               link       CDATA   #IMPLIED
               vlink      CDATA   #IMPLIED
               alink      CDATA   #IMPLIED>
               

<!-- Conditionals
       the names and basic functionality are copied from XSL,
       but the tests are considerably simpler.
-->
<!-- if: provides simple if-then functionality. If the test
     evaluates to true include the content of the element.
     Otherwise, discard the content of this element.
-->
<!ELEMENT   if            ANY>
<!ATTLIST   if
                test    %boolexpr; #REQUIRED>

<!-- choose: provides the ability to choose among multiple
     options. This feat is accomplished with the help of the
     when and otherwise elements.
-->
<!ELEMENT   choose   (when+,otherwise?)>

<!-- when: provides the tests for a choose element. If the test
     evaluates to true include the content of the element.
     Otherwise, prune this subtree.
-->
<!ELEMENT   when          ANY>
<!ATTLIST   when
                test    %boolexpr; #REQUIRED>

<!-- otherwise: provides the default behavior of the choose
     element. If none of the when tests evaluate to true, use
     the content of this element. Otherwise, discard the content
     of this element.
-->
<!ELEMENT   otherwise     ANY>


