<?xml encoding="ISO-8859-1"?>

<!--
   DTD for student project management - DRAFT !!

   VERSIONS:

   0.6 Changes: 
       - changed ldap-id: attributes (dn and host) instead of CDATA
       - added simple HTML-like links <a href="xxx">yyy</a>
       - added problems element to workpacke
       - added approval attribute to stamp entity (all tags)
       - added id attribute on stamp entity
       - added depends-on attribute to workpackage
       - defaults for years and month :)

   0.7 Changes:
       - made content in teacher-comment optional
       - added comment-status attribute to teacher comment
       - added to workpage: update-freq and update-day

   0.8 Changes:
       - student-answer added to teacher comments
       - added a idref attribute to a element (experimental)
   0.8a - use 2 digits for days and month (because of Xtract)
        - require at least ONE child (or DATA) for elements + NOT: *
          (note that mixed content tags CAN'T HAVE a +)

   0.9 - audit elements for workpackages (one for each WP also ?)

   Copyright: Daniel.Schneider@tecfa.unige.ch
              http://tecfa.unige.ch/tecfa-people/schneider.html

   This DTD and associated programs will be released under GPL or
   as freeware.

   Design rationale:
   - Should allow simple student project management (all of simple systems,
     texts, and research projects)
   - Should allow student-teacher interaction
   - Should be more or less human readable
   - I went for a rather hierachical tree, e.g. specficiationS instead of
     (specification)+ because I have the feeling that this will make tool
     programming and XSLT easier.

   ToDO:
   - figure how to represent dates (unix-time or humain readable)
   - Regular audit for workpackages (for each date + approval stamp ??)        
   - who does what

   DISCLAIMER: this is my first DTD (and XML Project)
                           -->

<!-- ****************************** ENTITY Declarations ******************* -->

<!--  For HTML entity freaks   -->

<!ENTITY agrave "&#192;"> <!-- latin capital letter A with grave
                                  = latin capital letter A grave,
                                  U+00C0 ISOlat1 -->
<!ENTITY aacute "&#193;"> <!-- latin capital letter A with acute,
                                  U+00C1 ISOlat1 -->
<!ENTITY acirc  "&#194;"> <!-- latin capital letter A with circumflex,
                                  U+00C2 ISOlat1 -->
<!ENTITY atilde "&#195;"> <!-- latin capital letter A with tilde,
                                  U+00C3 ISOlat1 -->
<!ENTITY auml   "&#196;"> <!-- latin capital letter A with diaeresis,
                                  U+00C4 ISOlat1 -->
<!ENTITY aring  "&#197;"> <!-- latin capital letter A with ring above
                                  = latin capital letter A ring,
                                  U+00C5 ISOlat1 -->
<!ENTITY aelig  "&#198;"> <!-- latin capital letter AE
                                  = latin capital ligature AE,
                                  U+00C6 ISOlat1 -->
<!ENTITY ccedil "&#199;"> <!-- latin capital letter C with cedilla,
                                  U+00C7 ISOlat1 -->
<!ENTITY egrave "&#200;"> <!-- latin capital letter E with grave,
                                  U+00C8 ISOlat1 -->
<!ENTITY eacute "&#201;"> <!-- latin capital letter E with acute,
                                  U+00C9 ISOlat1 -->
<!ENTITY ecirc  "&#202;"> <!-- latin capital letter E with circumflex,
                                  U+00CA ISOlat1 -->
<!ENTITY euml   "&#203;"> <!-- latin capital letter E with diaeresis,
                                  U+00CB ISOlat1 -->
<!ENTITY igrave "&#204;"> <!-- latin capital letter I with grave,
                                  U+00CC ISOlat1 -->
<!ENTITY iacute "&#205;"> <!-- latin capital letter I with acute,
                                  U+00CD ISOlat1 -->
<!ENTITY icirc  "&#206;"> <!-- latin capital letter I with circumflex,
                                  U+00CE ISOlat1 -->
<!ENTITY iuml   "&#207;"> <!-- latin capital letter I with diaeresis,
                                  U+00CF ISOlat1 -->
<!ENTITY eth    "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
<!ENTITY ntilde "&#209;"> <!-- latin capital letter N with tilde,
                                  U+00D1 ISOlat1 -->
<!ENTITY ograve "&#210;"> <!-- latin capital letter O with grave,
                                  U+00D2 ISOlat1 -->
<!ENTITY oacute "&#211;"> <!-- latin capital letter O with acute,
                                  U+00D3 ISOlat1 -->
<!ENTITY ocirc  "&#212;"> <!-- latin capital letter O with circumflex,
                                  U+00D4 ISOlat1 -->
<!ENTITY otilde "&#213;"> <!-- latin capital letter O with tilde,
                                  U+00D5 ISOlat1 -->
<!ENTITY ouml   "&#214;"> <!-- latin capital letter O with diaeresis,
                                  U+00D6 ISOlat1 -->
<!ENTITY times  "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
<!ENTITY oslash "&#216;"> <!-- latin capital letter O with stroke
                                  = latin capital letter O slash,
                                  U+00D8 ISOlat1 -->
<!ENTITY ugrave "&#217;"> <!-- latin capital letter U with grave,
                                  U+00D9 ISOlat1 -->
<!ENTITY uacute "&#218;"> <!-- latin capital letter U with acute,
                                  U+00DA ISOlat1 -->
<!ENTITY ucirc  "&#219;"> <!-- latin capital letter U with circumflex,
                                  U+00DB ISOlat1 -->
<!ENTITY uuml   "&#220;"> <!-- latin capital letter U with diaeresis,
                                  U+00DC ISOlat1 -->
<!ENTITY nbsp   "&#160;"> <!-- no-break space = non-breaking space,
                                  U+00A0 ISOnum -->


<!--   ... these are used as macros to make the code more tight   -->


<!ENTITY % stamp '
  id ID #IMPLIED        
  creation-day NMTOKEN #IMPLIED
  creation-month (00|01|02|03|04|05|06|07|08|09|10|11|12) "07"
  creation-year (0|1999|2000|2001) "1999"
  created-by NMTOKEN #IMPLIED
  mod-day NMTOKEN #IMPLIED
  mod-month (00|01|02|03|04|05|06|07|08|09|10|11|12) "07"
  mod-year (0000|1999|2000|2001) "1999"
  mod-by NMTOKEN #IMPLIED
  version NMTOKEN #IMPLIED
  status (draft|final|obsolete) #IMPLIED
  approval (ok|not-ok|so-so) #IMPLIED        
  main-author CDATA #IMPLIED
'
>

<!-- ****************************** The project ********************

    Main elements of the project (TOP Node)

    specifications: Can have several
  -->

<!ELEMENT project (title, 
                  (planning)?,
                  group, 
                  (specifications)?,
                  (problems)?,   
                  (resources)?,
                  (misc-info)?, 
                  (results)?,
                  (outlook)?,
                  (after-thoughts)?,
                  (teacher-comments)? )
                  >
<!ATTLIST project %stamp; >


<!-- ****************************** Project ID  ******************** -->

<!ELEMENT project-id EMPTY>
<!ATTLIST project-id
        id              ID #IMPLIED        
        course          CDATA #IMPLIED
>

<!-- ****************************** Group and Persons ******************** -->

<!ELEMENT group (person)+>

<!ELEMENT person ( (ldap-id)?, (contact-info)? ,(misc-info)?)>
<!ATTLIST person
 id ID #IMPLIED
>

<!ELEMENT contact-info EMPTY>
<!ATTLIST contact-info
  first-name          	CDATA #REQUIRED
  family-name          	CDATA #REQUIRED
  middle-initial 	CDATA #IMPLIED
  role                  (student|worker|supervisor|consultant|other) #IMPLIED
  home-url              CDATA #IMPLIED
  work-url              CDATA #IMPLIED
  email          	CDATA #REQUIRED
  %stamp;
>

<!ELEMENT ldap-id EMPTY>
<!ATTLIST ldap-id 
  host          NMTOKEN #REQUIRED
  dn            CDATA #REQUIRED        
>

<!-- ****************************** Specifications ******************** -->

<!ELEMENT specifications ((specification)+, (misc-info)?, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST specifications %stamp; >

<!ELEMENT specification (main-goal,
                         objectives,
                        (context)?, 
                        (workpackages)?,
                        (stories)?,
                        (resources)?,
                        (deliverables)?,
                        (problems)?, 
                        (after-thoughts)?, (teacher-comments)? )>
<!ATTLIST specification %stamp; >


<!ELEMENT main-goal (title, content, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST main %stamp; >


<!ELEMENT objectives ( (goal)+, (misc-info)?, (after-thoughts)?, (teacher-comments)? )>
<!ATTLIST objectives %stamp; >


<!ELEMENT goal (title, content, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST goal %stamp; >


<!ELEMENT context (#PCDATA | item | para | list)*>
<!ATTLIST context %stamp; >


<!ELEMENT workpackages ((workpackage)+, 
                        (misc-info)?, (after-thoughts)?, (teacher-comments)?, (audits)? )>
<!ATTLIST workpackages %stamp;
        update-freq CDATA #FIXED "une fois par semaine"
        update-day CDATA #FIXED "jeudi"
 >


<!ELEMENT workpackage (title, 
                       (planning)?,
                        (content)?,
                       (problems)?,
                       (misc-info)?,
                       (after-thoughts)?,
                       (teacher-comments)?)>
<!ATTLIST workpackage %stamp;
          depends-on IDREF #IMPLIED
 >


<!ELEMENT stories ((story)+, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST stories %stamp; >

<!ELEMENT story (title, content, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST story %stamp; >

<!ELEMENT deliverables ((deliverable)+, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST deliverables %stamp; >


<!ELEMENT deliverable (title, (content)?, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST deliverable %stamp; >


<!-- ****************************** Problem ******************** -->

<!ELEMENT problems ((problem)+, (misc-info)?, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST problems %stamp; >


<!ELEMENT problem (title, content, (solution)?, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST problem %stamp;
          problem-status (open|closed) "open"
 >


<!-- ****************************** Resources ********************
 Resources are people, articles, etc. used to produce something
 -->


<!ELEMENT resources ((resource)+, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST resources %stamp; >

<!ELEMENT resource (title, content, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST resource %stamp; >


<!-- ****************************** Results ******************** -->

<!ELEMENT results ((result)+, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST results %stamp; >

<!ELEMENT result (title, content, (after-thoughts)?, (teacher-comments)?)>
<!ATTLIST result %stamp; >


<!-- ****************************** Evaluation ******************** -->


<!ELEMENT teacher-comments ((teacher-comment | evaluation | student-answer)+, (after-thoughts)?)>
<!ATTLIST teacher-comments %stamp; >

<!ELEMENT audits ( audit+)>

<!ELEMENT audit (title, (content)? )>
<!ATTLIST audit eval (ok|attention) "ok"
%stamp;
>

<!ELEMENT teacher-comment (title, (content)?)>
<!ATTLIST teacher-comment 
        %stamp;
        comment-status (new|read|obsolete) "new"
 >

<!ELEMENT student-answer (title, (content)?)>
<!ATTLIST student-answer 
        %stamp;
          comment-status (new|read|obsolete) "new"
 >
        
<!ELEMENT evaluation (title, content, mark)?>
<!ATTLIST evaluation %stamp; >

<!-- ****************************** Common Items ******************** -->

<!ELEMENT a (#PCDATA)>
<!ATTLIST a
     href        CDATA   #IMPLIED
     target      CDATA   #IMPLIED
     idref       ID      #IMPLIED
>

<!ELEMENT misc-info (#PCDATA | a)*>

<!ELEMENT content (#PCDATA | item | para | list | a)*>
<!ELEMENT solution (#PCDATA | item | para | list | a)*>
<!ELEMENT after-thoughts (#PCDATA | item | para | list | a)*>
<!ELEMENT outlook (#PCDATA | item | para | list | a)*>

<!ELEMENT list (item)+>
<!ATTLIST list type (ul|ol) #REQUIRED>

<!ELEMENT para (#PCDATA |  a)*>
<!ELEMENT item (#PCDATA |  a)*>


<!ELEMENT mark (#PCDATA)>

<!ELEMENT title (#PCDATA)>

     
<!-- ******************************* Planning ********************* -->

<!ELEMENT planning EMPTY>
<!ATTLIST planning
  start-day NMTOKEN #REQUIRED
  start-month (00|01|02|03|04|05|06|07|08|09|10|11|12) "07"
  start-year (0|1999|2000|2001) "1999"
  end-day NMTOKEN #REQUIRED
  end-month (00|01|02|03|04|05|06|07|08|09|10|11|12) "07"
  end-year (0|1999|2000|2001) "1999"
  completion NMTOKEN #REQUIRED
  man-days NMTOKEN #REQUIRED
>



