<!-- XML DTD for Tcl Improvement Proposals (when formatted as XML.) -->

<!-- Written by Donal K. Fellows (fellowsd@cs.man.ac.uk), 1-5 Nov. 2000 -->

<!-- $Id: tipxml.dtd,v 1.5 2001-10-31 13:28:14 dkf Exp $ -->

<!-- This document is placed in the Public Domain. -->

<!-- ================================================================== -->
<!-- Entity declarations (a character, and several content models.)	-->
<!-- ================================================================== -->
<!ENTITY ff "&#12;"> <!-- Form feeds are relatively common characters	-->
                     <!-- in verbatim sections that are patches.	-->

<!-- Basic datatypes... -->
<!ENTITY % url 	      "CDATA"> <!-- Only permit URLs, may be partial.	-->
<!ENTITY % num 	      "CDATA"> <!-- Only permit non-negative integers.	-->

<!-- Simplify header declaration (later) by partitioning.		-->
<!ENTITY % header.req "title, author+, status, history, created">
<!ENTITY % header.opt "discussions*, keyword*, obsoletes*, obsoleted*">

<!-- Kinds of 'paragraphs': only inner can go inside lists.		-->
<!ENTITY % in.par     "enumerate | para | pre   | itemize | describe" >
<!ENTITY % out.par    "%in.par;  | rule | quote | index   | image" >

<!-- Mixed content for conventional paragraphs.				-->
<!ENTITY % emphtext   "#PCDATA | url | tipref">
<!ENTITY % text       "%emphtext; | emph">

<!-- ================================================================== -->
<!-- The outermost element of a TIP.                                    -->
<!-- ================================================================== -->
<!ELEMENT TIP (header, abstract, body)>
<!ATTLIST TIP number %num; #REQUIRED>

<!-- ================================================================== -->
<!-- TIP headers that are used for managing an archive.                 -->
<!-- ================================================================== -->
<!ELEMENT header (%header.req;, %header.opt;)>

<!ELEMENT title  (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ATTLIST author address %url; #REQUIRED>
<!ELEMENT status (#PCDATA)>	<!-- Content is the CVS Revision/Id.	-->
<!ATTLIST status
	type  (process|project|informative) 'informative'
	state (draft|active|accepted|deferred|final|rejected|withdrawn) 'draft'
	vote  (prior|during|after|none) 'prior'
	tclversion CDATA #IMPLIED
	>		<!-- Require tclversion ony when type='project'	-->
<!ELEMENT created EMPTY>
<!ATTLIST created
	day   %num; #REQUIRED
	month (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) 'jan'
	year  %num; #REQUIRED
	>
<!ELEMENT history (event*)>
<!ELEMENT event   (#PCDATA)>

<!ELEMENT discussions EMPTY>
<!ELEMENT obsoletes   EMPTY>
<!ELEMENT obsoleted   EMPTY>
<!ELEMENT keyword     (#PCDATA)>
<!ATTLIST discussions dest %url; #REQUIRED>
<!ATTLIST obsoletes   tip  %num; #REQUIRED>
<!ATTLIST obsoleted   tip  %num; #REQUIRED>

<!-- ================================================================== -->
<!-- The body of a TIP: sections consist of paragraph-like content      -->
<!--          optionally followed by subsections, subsections consist   -->
<!--          of paragraph-like content followed by subsubsections, and -->
<!--          subsubsections may only contain paragraph-like content.   -->
<!-- ================================================================== -->
<!ELEMENT body (section)+>

<!ELEMENT abstract (%text;)*>
<!ELEMENT section  ((%out.par;)*, subsection*)>
<!ATTLIST section  title CDATA #REQUIRED>

<!ELEMENT subsection ((%out.par;)*, subsubsection*)>
<!ATTLIST subsection  title CDATA #REQUIRED>

<!ELEMENT subsubsection (%out.par;)*>
<!ATTLIST subsubsection title CDATA #REQUIRED>

<!-- ================================================================== -->
<!-- Particles of sections, all conceptually paragraph-like...          -->
<!-- ================================================================== -->
<!ELEMENT para  (%text;)*>
<!ELEMENT quote (%text;)*>
<!ELEMENT pre   (#PCDATA)>
<!ATTLIST pre   xml:space (default|preserve) 'preserve'>
<!ELEMENT rule  EMPTY>
<!ELEMENT index ANY>		<!-- Actually a processing instruction. -->
<!ATTLIST index kind (short|medium|long) 'medium'>
<!ELEMENT image EMPTY>
<!ATTLIST image
	src     %url; #REQUIRED
	caption CDATA #IMPLIED
	>

<!-- ================================================================== -->
<!-- Lists are a special kind of paragraph-like content that can hold   -->
<!--          some kinds of paragraph-like content but not all.         -->
<!-- ================================================================== -->
<!ELEMENT itemize   (item.i)+>
<!ELEMENT enumerate (item.e)+>
<!ELEMENT describe  (item.d)+>
<!ELEMENT item.i    (%in.par;)*>
<!ELEMENT item.e    (%in.par;)*>
<!ELEMENT item.d    (%in.par;)*>

<!ATTLIST item.e  index %num; #REQUIRED>
<!ATTLIST item.d  name  CDATA #REQUIRED>

<!-- ================================================================== -->
<!-- Elements that are part of the flow of text in a paragraph.         -->
<!-- ================================================================== -->
<!ELEMENT emph (%emphtext;)*>		<!-- Emphs may not be nested.	-->
<!ELEMENT url EMPTY>
<!ATTLIST url ref %url; #REQUIRED>
<!ELEMENT tipref EMPTY>
<!ATTLIST tipref
	tip  %num;       #REQUIRED
	type (text|url) 'text'
	>

<!-- ================================================================== -->
