1 <!-- ============================================================= -->
2 <!-- Gamebook Document Type Definition v0.10 -->
3 <!-- ============================================================= -->
6 This DTD was designed around XML 1.0.
8 This gamebook DTD is aimed primarily at the books under development by
9 Project Aon (http://www.projectaon.org/). Future versions may be of
16 18 April 2003 (version 0.11.1)
17 * Added the following inline elements: "onomatopoeia", "spell",
20 27 January 2003 (version 0.11.0)
21 * Moved the optional "footnotes" element between the "meta" and
24 10 January 2003 (version 0.10.4)
25 * Removed the "inline.content" entity from the declaration of the
26 contents of the "blockquote" element. This will break some existing
29 7 January 2003 (version 0.10.3)
30 * Made the "src", "width", and "height" attributes of the "instance"
33 4 January 2003 (version 0.10.2)
34 * Moved the specialized character entity definitions into module
37 5 October 2002 (version 0.10.1)
38 * Added the "lellips" and "minus" entities and changed the definition
39 of the "emdash" entity.
41 5 September 2002 (version 0.10.0)
42 * Added the "quote" element.
44 31 August 2002 (version 0.9.1)
45 * Added the "xml:lang" attribute to the "core.attributes" entity.
46 Although this could be used for most elements, it is primarily
47 aimed at the "foreign" element.
49 6 July 2002 (version 0.9)
50 * Replaced the "caption" element and the "illustrator" attribute with
51 the use of the "meta" element.
52 * Renamed the "illustration-instance" element to simply "instance".
53 * Removed the "character-attribute" element.
54 * Added the "typ" element for typographical markup.
55 * Removed the "shortname" attribute.
57 1 June 2002 (version 0.8.3)
58 * Removed the "marker" attribute from the "footnote" element.
60 29 April 2002 (vesion 0.8.2)
61 * Changed the content of the "enemy" element from "#PCDATA" to
64 4 April 2002 (version 0.8.1)
65 * Added the "thinspace" entity
67 3 April 2002 (version 0.8.0)
68 * Added the "thought" element.
69 * Added the "foreign" element.
71 15 March 2002 (version 0.7.0)
72 * Changed the name of the "illustration-set" element to "illustration"
73 and changed the name of the "illustration" element to
74 "illustration-instance".
75 * Made many minor changes to bring the DTD up to current practice.
77 11 May 2001 (version 0.6.0)
78 * Removed the "publication-date" element.
80 5 May 2001 (version 0.5.0)
81 * Added facilities for transformation to LaTeX - mainly appropriate
83 * Added the "marker" attribute to the "footnote" element.
85 1 May 2001 (version 0.4.0)
87 * Added the "link" element to the set of allowable "meta" elements.
88 Although not a Dublin Core meta-data element, it's functionality
89 adds a lot to the document.
91 30 April 2001 (version 0.3.0)
93 * Changed the basic orgranization of the sections by allowing them to
94 have their own meta section instead of a "section-title" element.
95 * Changed the name of the "section-data" element to simply "data".
97 17 April 2001 (version 0.2.0)
99 * Changed some of the block and inline elements in order to make them
102 14 April 2001 (version 0.1.0)
106 <!-- ============================================================= -->
108 <!-- ============================================================= -->
109 <!-- Table of Contents -->
110 <!-- ============================================================= -->
116 B. Character Entities
117 II. Hierarchical Elements
122 A. Valid Document Example
126 <!-- ============================================================= -->
128 <!-- ============================================================= -->
130 <!-- ::::::::::::::::::::: General Entities :::::::::::::::::::::: -->
132 <!ENTITY % block.content "p | ul | ol | dl | table | blockquote | illustration | combat | choice | signpost | hr">
134 <!ENTITY % inline.content "#PCDATA | a | em | strong | thought | foreign | quote | cite | code | br | typ | onomatopoeia | spell | item">
136 <!ENTITY % core.attributes "
138 xml:lang CDATA #IMPLIED
141 <!ENTITY % link.attributes "
146 <!ENTITY % cell.align.attributes "
147 align ( left | center | right | justify | char ) #IMPLIED
149 valign ( top | middle | bottom | baseline ) #IMPLIED
152 <!-- :::::::::::::::::::: Character Entities ::::::::::::::::::::: -->
154 <!ENTITY lt "&#60;"><!-- left angle bracket -->
155 <!ENTITY gt ">"> <!-- right angle bracket -->
156 <!ENTITY amp "&#38;"><!-- ampersand -->
157 <!ENTITY apos "'"> <!-- apostrophe = single quotation mark -->
158 <!ENTITY quot """> <!-- double quotation mark -->
163 It is the responsibility of the document to define relevant character
164 entities in its internal subset.
168 <!-- ============================================================= -->
169 <!-- Hierarchical Elements -->
170 <!-- ============================================================= -->
173 <!ELEMENT gamebook ( meta, section+ )>
175 version CDATA #REQUIRED
176 xml:lang CDATA #IMPLIED
180 The "version" attribute represents the revision number of the gamebook
181 DTD. This allows gamebook processors to make decisions about the
182 suitability of the data.
184 The "xml:lang" attribute specifies the primary language of the
185 document. The data should conform to the IETF RFC1766.
187 http://www.ietf.org/rfc/rfc1766.txt
191 <gamebook version="0.11" xml:lang="en-UK">
192 <meta . . .> . . . </meta>
193 <section . . .> . . . </section>
197 <gamebook version="0.11" > . . . </gamebook>
201 <!-- :::::::::::::::::::::::: meta Element ::::::::::::::::::::::: -->
204 The children of the meta element are designed to directly translate to
205 the Dublin Core Element Set v1.1. For a description of each Dublin
206 Core element, visit the following URL:
208 (http://dublincore.org/documents/1999/07/02/dces/)
210 Although many Dublin Core elements will probably never have any real
211 relevance to gamebooks, all are included for completeness's sake.
213 [editor: add dc: namespace to isolate dublin core elements
214 http://dublincore.org/documents/2001/10/26/dcmi-namespace/ ]
216 Note: The "link" element doesn't correspond directly to any Dublin
217 Core element. It has been added here for required functionality.
220 <!ELEMENT meta ( title | creator | subject | description | publisher | contributor | date | type | format | identifier | source | language | relation | coverage | rights | link)*>
223 The "meta" element represents underlying information about the
224 document. It should contain any number of the Dublin Core 1.1
230 <title . . .> . . . </title>
231 <creator . . .> . . . </creator>
237 <!ELEMENT title ( %inline.content; )*>
242 <!ELEMENT creator ( %inline.content; | %block.content; )*>
247 <!ELEMENT subject ( %inline.content; | %block.content; )*>
252 <!ELEMENT description ( %inline.content; | %block.content; )*>
253 <!ATTLIST description
257 <!ELEMENT publisher ( %inline.content; | %block.content; )*>
262 <!ELEMENT contributor ( %inline.content; | %block.content; )*>
263 <!ATTLIST contributor
267 <!ELEMENT date ( year, month, day )>
273 The "date" element has been extended beyond the specification made in
274 the Dublin Core. It should contain "year", "month" and "day" elements.
279 <year . . .> . . . </year>
280 <month . . .> . . . </month>
281 <day . . .> . . . </day>
286 <!ELEMENT year ( #PCDATA )>
289 The year should be specified in full digit numeric format.
297 <!ELEMENT month ( #PCDATA )>
300 The month should be specified in numeric format with January as "1",
301 February as "2", etc.
309 <!ELEMENT day ( #PCDATA )>
312 The "day" element specifies the day of the month in numeric format.
320 <!ELEMENT type ( %inline.content; )*>
325 <!ELEMENT format ( %inline.content; )*>
330 <!ELEMENT identifier ( %inline.content; )*>
335 <!ELEMENT source ( %inline.content; )*>
340 <!ELEMENT language ( %inline.content; )*>
345 <!ELEMENT relation ( %inline.content; )*>
350 <!ELEMENT coverage ( %inline.content; | %block.content; )*>
355 <!ELEMENT rights ( %inline.content; | %block.content; )*>
360 <!ELEMENT link EMPTY>
364 idrefs IDREFS #IMPLIED>
367 The "link" element has been added to the Dublin Core elements to
368 represent relationships to other parts of the document. The "idrefs"
369 attribute has been added to allow relationships that are held with
370 more than one part of the document.
374 <link class="next" idref="dedicate" />
376 <link class="friends" idrefs="dedicate cmbtrulz" />
380 <!-- ::::::::::::::::::::: section Element ::::::::::::::::::::::: -->
382 <!ELEMENT section ( meta, footnotes?, data )>
389 The "section" element represents one hierarchical level of data.
390 Section elements can be nested (inside the "data" element) in
391 order to create more complex data representations.
393 A "section" element can used as a linking element. The most useful way
394 to utilize this is to make it a named anchor and thus the target of a
400 <meta><title . . .> . . . </title></meta>
401 <data . . .> . . . </data>
402 <footnotes . . .> . . . </footnotes>
406 <meta><title . . .> . . . </title></meta>
409 <section id="dedication">
410 <meta><title . . .> . . . </title></meta>
411 <data . . .> . . . </data>
419 <!ELEMENT data ( %block.content; | section )*>
425 The "data" element contains the main data contained within
426 a section. Note that a nested section structure can be created by
427 including a "section" element within the content of the "data"
434 <combat . . .> . . . </combat>
439 <section . . .> . . . </section>
444 <!ELEMENT footnotes ( footnote )*>
450 The "footnotes" element represents the collection of extra-textual
451 information contained within "footnote" elements.
456 <footnote . . .> . . . </footnote>
457 <footnote . . .> . . . </footnote>
463 <!ELEMENT footnote ( %block.content; )*>
470 The "footnote" element contains extra-textual information. It can be
471 used as a linking element and can thus be used to refer back to a
472 named anchor within the document.
477 <p . . .>This paragraph requires an appropriate
478 <a id="reference" idref="footnote-reference" . . .>footnote</a>.
483 <footnote id="footnote-reference" idref="reference">
484 <p . . .>This is the appropriate footnote.</p>
491 <!-- ============================================================= -->
492 <!-- Block Elements -->
493 <!-- ============================================================= -->
495 <!-- :::::::::::::::::::::::::: Lists :::::::::::::::::::::::::::: -->
497 <!ELEMENT ul ( li )*>
503 The "ul" represents an unordered list.
508 <li . . .> . . . </li>
509 <li . . .> . . . </li>
515 <!ELEMENT ol ( li )*>
521 The "ol" element represents an ordered list.
526 <li . . .> . . . First Item . . . </li>
527 <li . . .> . . . Second Item . . . </li>
533 <!ELEMENT li ( %inline.content; | %block.content; )*>
539 The "li" element is a generic list item used within both ordered and
540 unordered lists (i.e. "ol" and "ul" elements).
547 <li>another list item</li>
552 <li>first list item</li>
553 <li>second list item</li>
559 <!ELEMENT dl ( dt, dd? )*>
565 The "dl" element represents a list of terms and their definitions.
570 <dt . . .> . . . First Term . . . </dt>
571 <dd . . .> . . . First Term's Definition . . . </dd>
573 <dt . . .> . . . Second Term . . . </dt>
574 <dd . . .> . . . Second Term's Definition . . . </dd>
575 <dt . . .> . . . Third Term with No Definition . . . </dt>
580 <!ELEMENT dt ( %inline.content; )*>
586 The "dt" element represents a definition term within a definition
587 list. It should be immediately followed by its definitions contained
588 within "dd" elements.
594 <dt>Definition Term</dt>
595 <dd . . .> . . . Definition . . . </dd>
601 <!ELEMENT dd ( %inline.content; | %block.content; )*>
607 The "dd" element contains a definition.
611 <dt . . .> . . . Term to be defined . . . </dt>
612 <dd>Definition of the term.</dd>
616 <!-- :::::::::::::::::::::::::: Tables ::::::::::::::::::::::::::: -->
618 <!ELEMENT table ( tr )*>
624 The "table" element represents tabular data. It's data is organized
630 <tr . . .> . . . </tr>
631 <tr . . .> . . . </tr>
637 <!ELEMENT tr ( th | td )*>
643 The "tr" element contains a collection of "th" and "td" elements that
644 represent one row of a "table".
651 <th . . .> . . . </th>
652 <td . . .> . . . </td>
660 <!ELEMENT th ( %inline.content; )*>
663 %cell.align.attributes;
667 The "th" contains a table header used to label a particular row or
668 column of tabular data.
675 <td . . .> . . . </td>
676 <td . . .> . . . </td>
682 <!ELEMENT td ( %inline.content; )*>
685 %cell.align.attributes;
689 The "td" element contains one cell of tabular data.
701 <!-- :::::::::::::::::::::: Miscellaneous :::::::::::::::::::::::: -->
703 <!ELEMENT p ( %inline.content; )*>
709 The "p" element contains a paragraph.
713 <p>This is a (short) paragraph.</p>
717 <!ELEMENT blockquote ( %block.content; )*>
723 The "blockquote" element contains a lengthy quotation which isn't
724 contained within a paragraph.
729 <p>There was once a Kai monk from Sommerlund . . .</p>
734 <!ELEMENT combat ( enemy, enemy-attribute+ )>
740 The "combat" element contains one combat represented by the enemy's
746 <enemy . . .> . . . </enemy>
747 <enemy-attribute . . .> . . . </enemy-attribute>
748 <enemy-attribute . . .> . . . </enemy-attribute>
754 <!ELEMENT enemy ( %inline.content; )*>
760 The "enemy" element contains an enemy's name.
766 <enemy>12-foot Giak</enemy>
772 <!ELEMENT enemy-attribute ( #PCDATA )*>
773 <!ATTLIST enemy-attribute
778 The "enemy-attribute" element contains one particular attribute which
785 <enemy-attribute>30</enemy-attribute>
791 <!ELEMENT choice ( %inline.content; | link-text )*>
798 The "choice" element contains the text describing a choice presented
799 within a section. It's a linking element and therefore can link to
800 the place to which the choice leads.
802 The choice element can contain "link-text" elements which suggest text
803 that should be used by the user agent to represent the hyperlink.
807 <section id="section12" . . .> . . . </section>
809 <choice idref="section12">If you would like to fight the 12-foot Giak,
810 <link-text . . .> . . . turn to 12. . . . </link-text>
815 <!ELEMENT link-text ( %inline.content; )*>
821 The "link-text" element contains text which is suggested for use by
822 hypertext user interfaces to represent one end of a hyperlink.
828 <link-text>the unfortunately ubiquitous "Click Here!"</link-text>
834 <!ELEMENT illustration ( meta?, instance+ )>
835 <!ATTLIST illustration
842 The "illustration" element contains a set of alternate
843 representations of a particular illustration.
849 <instance . . .> . . . </instance>
850 <instance . . .> . . . </instance>
856 <!ELEMENT instance ( %inline.content; | %block.content; )*>
861 height CDATA #IMPLIED
862 mime-type CDATA #IMPLIED
866 The "instance" element describes one instance of an illustration.
868 The "src" attribute is a URL for the data file for the illustration.
870 The "width" and "height" attributes contain the dimensions of the
873 The "mime-type" attribute can contain an appropriate label for the
874 format of the illustration file (e.g. "image/png" or "image/jpeg").
876 The "instance" element can contain block or inline content that
877 is intended to replace graphical illustrations.
883 <instance src="17.gif" width="386" height="532" type="image/gif" />
884 <instance src="" width="" height="" type="text" >
892 <!ELEMENT signpost ( %inline.content; | %block.content; )*>
898 The "signpost" element contains the text of a sign or message that
899 should be presented offset from surrounding text.
903 <signpost>RENDALIM'S LABORATORY</signpost>
913 The "hr" element designates a horizontal rule. Since this is a
914 presentational tag, it should be used sparingly in cases where new
915 logical divisions of the text begin which aren't given a unique
924 <!-- ============================================================= -->
925 <!-- Inline Elements -->
926 <!-- ============================================================= -->
928 <!ELEMENT a ( %inline.content; )*>
936 The "a" element is used to contain inline content that should be a
939 The "href" attribute is added to allow a reference outside of the
946 <a idref="section12" id="foo">Section 12</a>
952 <!ELEMENT em ( %inline.content; )*>
958 The "em" element contains text that should be emphasized. Although not
959 part of the DTD and therefore not guaranteed or required to be so, the
960 text should be typeset with an italic font.
964 <em>You are being attacked!</em>
970 <!ELEMENT strong ( %inline.content; )*>
976 The "strong" element contains text that should be emphasized. Although
977 not part of the DTD and therefore not guaranteed or required to be so,
978 the text should be typeset with a bold font weight.
982 <strong>If</strong> you have the Talisman of Supreme Obscurity,
988 <!ELEMENT thought ( %inline.content; )*>
994 The "thought" element contains text that is the character's thoughts or is
995 an overheard thought. Although not part of the DTD and therefore not
996 guaranteed or required to be so, the text should be typeset with an italic
1001 Lone Wolf heard the words <thought>Die Northlander!</strong> echo in
1008 <!ELEMENT foreign ( %inline.content; )*>
1014 The "foreign" element contains a phrase in a non-native language.
1015 Although not part of the DTD and therefore not guaranteed or required
1016 to be so, the text should be typeset with an italic font face.
1020 The Giak horde attacked <foreign>en masse</foreign>.
1026 <!ELEMENT quote ( %inline.content; )*>
1032 The "quote" element contains an inline quotation.
1036 <p . . .>The Giak yelped <quote . . .>Oww!</quote></p>
1040 <!ELEMENT cite ( %inline.content; )*>
1046 The "cite" element contains the title of a sited resource.
1052 <cite>Flight from the Dark</cite>
1058 <!ELEMENT code ( %inline.content; )*>
1064 The "code" element contains data that should be interpreted as literal
1065 input to a computer (e.g. email addresses and URIs).
1069 <code>staff@projectaon.org</code>
1079 The "br" indicates a required line break. Its use should be confined
1080 to documents such as poems that require a particular line structure.
1086 There once was a Kai monk from Sommerlund<br />
1087 Who always wore a cummerbund<br />
1093 <!ELEMENT typ ( #PCDATA )>
1099 The "typ" element is used to denote purely typographical markup. For
1100 example, bold font face, italics, and smaller font are purely of
1101 typographical concern. Take care to not use this in place of logical
1102 markup such as the "em" element when it is more appropriate.
1106 The <typ class="bold">Project Aon</a> volunteers.
1110 <!ELEMENT onomatopoeia ( #PCDATA )>
1111 <!ATTLIST onomatopoeia
1116 The "onomatopoeia" element is used to denote words that imitate a
1117 sound (e.g., "whoosh", "bang").
1121 The <onomatopoeia>clang</onomatopoeia> of the bell is deafening.
1125 <!ELEMENT spell ( #PCDATA )>
1131 The "spell" element contains the name of a magic spell.
1135 Having had no success with his female peers, the acolyte learned the
1136 forbidden <spell>Attract Opposite Gender</spell> spell.
1140 <!ELEMENT item ( #PCDATA )>
1146 The "item" element contains the name of an item that the reader can
1147 pick up or interact with.
1151 Her <item>Sword</a> lay just out of reach.
1155 <!-- ============================================================= -->
1157 <!-- ============================================================= -->
1159 <!-- :::::::::::::: Valid Gamebook Document Example :::::::::::::: -->
1161 This document is not intended to document current practice in Project
1162 Aon. It is merely here to demonstrate the concepts of the Gamebook
1163 DTD. For current practice, please refer to published XML files.
1168 <?xml version="1.0" encoding="iso-8859-1"?>
1169 <!DOCTYPE gamebook SYSTEM "gamebook.dtd">
1171 <gamebook version="0.11" xml:lang="en-UK">
1174 <title>Flight from the Dark</title>
1175 <creator>Joe Dever and Gary Chalk</creator>
1176 <publisher>Project Aon</publisher>
1177 <date><year>2001</year><month>10</month><day>24</day></date>
1178 <rights>Copyright © 1984 Joe Dever and Gary Chalk.</rights>
1181 <section id="section1">
1182 <meta><title>1</title></meta>
1184 <p>You must make haste for you sense it is not safe to linger by the smoking remains of the ruined monastery. The black-winged beasts could return at any moment. You must set out for the Sommerlund capital of Holmgard and tell the King the terrible news of the massacre: that the whole élite of Kai warriors, save yourself, have been slaughtered. Without the Kai Lords to lead her armies, Sommerlund will be at the mercy of their ancient enemy, the Darklords.</p>
1185 <p>Fighting back tears, you bid farewell to your dead kinsmen. Silently, you promise that their deaths will be avenged. You turn away from the ruins and carefully descend the steep track.</p>
1186 <p>At the foot of the hill, the path splits into two directions, both leading into a large wood.</p>
1188 <choice idref="section85">If you wish to take the right path into the wood, <link-text>turn to 85</link-text>.</choice>
1189 <choice idref="section275">If you wish to follow the left track, <link-text>turn to 275</link-text>.</choice>
1190 <choice idref="section141">If you wish to use your Kai Discipline of Sixth Sense, <link-text>turn to 141</link-text>.</choice>
1193 <footnote><p>Later books use <quote>Sommlending</quote> as the possessive adjective for Sommerlund, contrary to the use of the word <quote>Sommerlund</quote> in the third sentence. This is probably not a typo, but a reflection of Joe Dever's later expansion of the vocabulary of Magnamund.</p></footnote>
1197 <section id="section17">
1198 <meta><title>17</title></meta>
1200 <p>You raise your weapon to strike at the beast as its razor-fanged mouth snaps shut just inches from your head. Buffeted by the beating of its wings you find it difficult to stand.</p>
1203 <instance src="1.gif" width="386" height="532" mime-type="image/gif" />
1206 <p>Deduct 1 point from your <typ class="attribute">COMBAT SKILL</typ> and fight the Kraan.</p>
1209 <enemy>Kraan:</enemy>
1210 <enemy-attribute>16</enemy-attribute>
1211 <enemy-attribute>24</enemy-attribute>
1214 <p>If you kill the creature, you quickly descend the far side of the hill to avoid the Giaks.</p>
1215 <p>Pick a number from the Random Number Table.</p>
1217 <choice idref="section53">If you pick 0, <link-text>turn to 53</link-text>.</choice>
1218 <choice idref="section274">If you pick 1&endash;2, <link-text>turn to 274</link-text>.</choice>
1219 <choice idref="section316">If you pick 3&endash;9, <link-text>turn to 316</link-text>.</choice>
1223 <section id="section53">
1224 <meta><title>53</title></meta>
1228 <section id="section85">
1229 <meta><title>85</title></meta>
1233 <section id="section141">
1234 <meta><title>141</title></meta>
1238 <section id="section274">
1239 <meta><title>274</title></meta>
1243 <section id="section275">
1244 <meta><title>275</title></meta>
1248 <section id="section316">
1249 <meta><title>316</title></meta>