XBook - Authoring Documents (doc.dtd)

Author: Just van den Broecke
Organization: Just Objects B.V.
Email: just@justobjects.nl

FileID: $Id: authoring-doc.xml,v 1.4 2003/01/06 10:28:08 just Exp $
Date: July 8, 2002

This document describes how to author documentation using doc.dtd provided with XBook. This DTD can be used to author structured documents like articles, design documentation, manuals etc. In fact this very document you are reading is written according to doc.dtd.


1. Overview

THIS ENTIRE DOCUMENT IS WORK IN PROGRESS

This DTD defines a structured document suitable for articles, memos, manuals (like this one!) and design documentation. The document structure is kept reasonally simple. Each document has has three top elements: the front, the middle and the optional back.

Most of the tags in doc.dtd are included from text.dtd. See the Authoring Text (text.dtd) guide.

Power users may immediately go to the DTD definition.

2. The Front

2.1. Purpose

Provide an element to define all meta information on the document like title, authors, date etc.

2.2. Example

2.2.1. Construct

The front of this guide is displayed below. Note that you may also use multiple author elements.

6: <front> 7: <title>XBook - Authoring Documents (doc.dtd)</title> 8: 9: <id>$Id: authoring-doc.xml,v 1.4 2003/01/06 10:28:08 just Exp $</id> 10: 11: <author> 12: <name>Just van den Broecke</name> 13: <organization>Just Objects B.V.</organization> 14: <email>just@justobjects.nl</email> 15: </author> 16: 17: <date>July 8, 2002</date> 18: 19: <abstract> 20: This document describes how to author documentation using doc.dtd provided with XBook. 21: This DTD can be used to author structured documents like articles, design documentation, manuals etc. 22: In fact this very document you are reading is written according to doc.dtd. 23: </abstract> 24: </front>

3. The Middle

3.1. Purpose

Provide an element to define all content of the document.

3.2. Example

3.2.1. Construct

The middle of this guide is displayed below. Note that you only are allowed to use section1 elements as childs of the middle section. Different as in HTML the section[1-8] elements must enclose the entire section text. You may nest sections up to section8 (special feature for Jan-Marten).

28: <middle> 29: 30: <section1 title="Overview"> 31: <para> 32: THIS ENTIRE DOCUMENT IS WORK IN PROGRESS 33: </para> 34: <para> 35: This DTD defines a structured document suitable for articles, memos, manuals (like this one!) and 36: design documentation. The document structure is kept reasonally simple. Each document has has 37: three top elements: the front, the middle and the optional back. 38: </para> 39: <para> 40: Most of the tags in doc.dtd are included from text.dtd. 41: See the <link href="authoring-text.html">Authoring Text (text.dtd)</link> guide. 42: </para> 43: <para> 44: Power users may immediately go to the <link href="#dtd.def">DTD definition</link>. 45: </para> 46: </section1> 47: 48: <section1 id="doc.front" title="The Front"> 49: <section2 title="Purpose"> 50: <para>Provide an element to define all meta information on the document like title, authors, date etc. 51: </para> 52: </section2> 53: <section2 title="Example"> 54: <section3 title="Construct"> 55: <para>The front of this guide is displayed below. Note that you may also use multiple <code>author</code> elements.</para> 56: <listing> 57: <include href="authoring-doc.xml" range="doc.front" /> 58: </listing> 59: </section3> 60: </section2> 61: </section1> 62: 63: <section1 id="doc.middle" title="The Middle"> 64: <section2 title="Purpose"> 65: <para>Provide an element to define all content of the document. 66: </para> 67: </section2> 68: <section2 title="Example"> 69: <section3 title="Construct"> 70: <para>The middle of this guide is displayed below. Note that you only are allowed to use <code>section1</code> 71: elements as childs of the middle section. Different as in HTML the <code>section[1-8]</code> 72: elements must enclose the entire section text. You may nest sections up to section8 (special feature for Jan-Marten).</para> 73: <listing> 74: <include href="authoring-doc.xml" range="doc.middle" /> 75: </listing> 76: </section3> 77: </section2> 78: </section1> 79: 80: <section1 id="doc.back" title="The Back"> 81: <section2 title="Purpose"> 82: <para>Provide an element to define a back section of the document. 83: </para> 84: </section2> 85: <section2 title="Example"> 86: <section3 title="Construct"> 87: <para>The back of this guide is displayed below. Note that you may leave out the <code>back</code> entirely.</para> 88: <para>Linking: you may use the "id" of each <code>reference-item</code> for internal linking with the <code>link</code> element 89: similar to linking to <code>anchor</code> and <code>section[1-4]</code>.</para> 90: <listing> 91: <include href="authoring-doc.xml" range="doc.back" /> 92: </listing> 93: </section3> 94: </section2> 95: </section1> 96: 97: <section1 title="Full Example"> 98: <para> 99: This example is the file <code>xdoc/authoring-doc.xml</code> used to generate the document you are 100: reading. Notice the use of the <code>&lt;include&gt;</code> element to include (parts of) XML files. 101: </para> 102: <listing> 103: <include href="authoring-doc.xml" /> 104: </listing> 105: </section1> 106: 107: <section1 id="dtd.def" title="DTD Definition"> 108: <para>Below is the actual DTD file.</para> 109: <listing> 110: <include href="assets/doc.dtd" /> 111: </listing> 112: </section1> 113: 114: 115: </middle>

4. The Back

4.1. Purpose

Provide an element to define a back section of the document.

4.2. Example

4.2.1. Construct

The back of this guide is displayed below. Note that you may leave out the back entirely.

Linking: you may use the "id" of each reference-item for internal linking with the link element similar to linking to anchor and section[1-4].

119: <back> 120: <reference-list> 121: <reference-item id="W3C"> 122: World Wide Web Consortium. <link href="http://www.w3.org"> 123: http://www.w3c.org</link> 124: </reference-item> 125: <reference-item id="W3C-XML"> 126: World Wide Web Consortium. <strong>Extensible Markup Language (XML) 1.0.</strong> 127: W3C Recommendation; <link href="http://www.w3.org/TR/1998/REC-xml-19980210"> 128: http://www.w3.org/TR/1998/REC-xml-19980210</link> 129: </reference-item> 130: </reference-list> 131: </back>

5. Full Example

This example is the file xdoc/authoring-doc.xml used to generate the document you are reading. Notice the use of the <include> element to include (parts of) XML files.

1: <?xml version="1.0" encoding="UTF-8"?> 2: <!DOCTYPE doc SYSTEM "nl/justobjects/xbook/rsc/dtd/doc.dtd" > 3: 4: <doc> 5: <!--{doc.front --> 6: <front> 7: <title>XBook - Authoring Documents (doc.dtd)</title> 8: 9: <id>$Id: authoring-doc.xml,v 1.4 2003/01/06 10:28:08 just Exp $</id> 10: 11: <author> 12: <name>Just van den Broecke</name> 13: <organization>Just Objects B.V.</organization> 14: <email>just@justobjects.nl</email> 15: </author> 16: 17: <date>July 8, 2002</date> 18: 19: <abstract> 20: This document describes how to author documentation using doc.dtd provided with XBook. 21: This DTD can be used to author structured documents like articles, design documentation, manuals etc. 22: In fact this very document you are reading is written according to doc.dtd. 23: </abstract> 24: </front> 25: <!--}doc.front --> 26: 27: <!--{doc.middle --> 28: <middle> 29: 30: <section1 title="Overview"> 31: <para> 32: THIS ENTIRE DOCUMENT IS WORK IN PROGRESS 33: </para> 34: <para> 35: This DTD defines a structured document suitable for articles, memos, manuals (like this one!) and 36: design documentation. The document structure is kept reasonally simple. Each document has has 37: three top elements: the front, the middle and the optional back. 38: </para> 39: <para> 40: Most of the tags in doc.dtd are included from text.dtd. 41: See the <link href="authoring-text.html">Authoring Text (text.dtd)</link> guide. 42: </para> 43: <para> 44: Power users may immediately go to the <link href="#dtd.def">DTD definition</link>. 45: </para> 46: </section1> 47: 48: <section1 id="doc.front" title="The Front"> 49: <section2 title="Purpose"> 50: <para>Provide an element to define all meta information on the document like title, authors, date etc. 51: </para> 52: </section2> 53: <section2 title="Example"> 54: <section3 title="Construct"> 55: <para>The front of this guide is displayed below. Note that you may also use multiple <code>author</code> elements.</para> 56: <listing> 57: <include href="authoring-doc.xml" range="doc.front" /> 58: </listing> 59: </section3> 60: </section2> 61: </section1> 62: 63: <section1 id="doc.middle" title="The Middle"> 64: <section2 title="Purpose"> 65: <para>Provide an element to define all content of the document. 66: </para> 67: </section2> 68: <section2 title="Example"> 69: <section3 title="Construct"> 70: <para>The middle of this guide is displayed below. Note that you only are allowed to use <code>section1</code> 71: elements as childs of the middle section. Different as in HTML the <code>section[1-8]</code> 72: elements must enclose the entire section text. You may nest sections up to section8 (special feature for Jan-Marten).</para> 73: <listing> 74: <include href="authoring-doc.xml" range="doc.middle" /> 75: </listing> 76: </section3> 77: </section2> 78: </section1> 79: 80: <section1 id="doc.back" title="The Back"> 81: <section2 title="Purpose"> 82: <para>Provide an element to define a back section of the document. 83: </para> 84: </section2> 85: <section2 title="Example"> 86: <section3 title="Construct"> 87: <para>The back of this guide is displayed below. Note that you may leave out the <code>back</code> entirely.</para> 88: <para>Linking: you may use the "id" of each <code>reference-item</code> for internal linking with the <code>link</code> element 89: similar to linking to <code>anchor</code> and <code>section[1-4]</code>.</para> 90: <listing> 91: <include href="authoring-doc.xml" range="doc.back" /> 92: </listing> 93: </section3> 94: </section2> 95: </section1> 96: 97: <section1 title="Full Example"> 98: <para> 99: This example is the file <code>xdoc/authoring-doc.xml</code> used to generate the document you are 100: reading. Notice the use of the <code>&lt;include&gt;</code> element to include (parts of) XML files. 101: </para> 102: <listing> 103: <include href="authoring-doc.xml" /> 104: </listing> 105: </section1> 106: 107: <section1 id="dtd.def" title="DTD Definition"> 108: <para>Below is the actual DTD file.</para> 109: <listing> 110: <include href="assets/doc.dtd" /> 111: </listing> 112: </section1> 113: 114: 115: </middle> 116: <!--}doc.middle --> 117: 118: <!--{doc.back --> 119: <back> 120: <reference-list> 121: <reference-item id="W3C"> 122: World Wide Web Consortium. <link href="http://www.w3.org"> 123: http://www.w3c.org</link> 124: </reference-item> 125: <reference-item id="W3C-XML"> 126: World Wide Web Consortium. <strong>Extensible Markup Language (XML) 1.0.</strong> 127: W3C Recommendation; <link href="http://www.w3.org/TR/1998/REC-xml-19980210"> 128: http://www.w3.org/TR/1998/REC-xml-19980210</link> 129: </reference-item> 130: </reference-list> 131: </back> 132: <!--}doc.back --> 133: </doc>

6. DTD Definition

Below is the actual DTD file.

1: <?xml version="1.0" encoding="UTF-8"?> 2: 3: <!-- 4: DTD for basic documents like manuals, etc. 5: 6: $Author: just $ 7: $Id: doc.dtd,v 1.12 2003/11/19 15:12:09 just Exp $ 8: 9: This DTD defines only the overall structure of a structured document. 10: The document is divided into three parts: front, middle and back. 11: The front defines meta info like author(s) date etc. The middle defines 12: the body (content) and the optional back contains references. 13: 14: Most of the content elements are defined in text.dtd. 15: 16: --> 17: 18: <!-- Reuse text.dtd for simple text formatting --> 19: <!ENTITY % text-dtd PUBLIC "-//Just Objects//DTD XBook//EN" "nl/justobjects/xbook/rsc/dtd/text.dtd"> 20: <!-- <!ENTITY % text-dtd SYSTEM "nl/justobjects/xbook/rsc/dtd/text.dtd"> --> 21: %text-dtd; 22: 23: 24: <!-- The top element --> 25: <!ELEMENT doc (front,middle,back?)> 26: <!ATTLIST doc 27: label CDATA 'unlabeled' 28: > 29: 30: <!-- START front definition --> 31: 32: <!ELEMENT front (title,id?,author+,date,abstract)> 33: 34: <!-- Elements within the front --> 35: <!ELEMENT title (%CTEXT;)> 36: 37: <!ELEMENT id (%CTEXT;)> 38: 39: <!ELEMENT author (name, organization, email)> 40: <!ELEMENT name (%CTEXT;)> 41: <!ELEMENT organization (%CTEXT;)> 42: <!ELEMENT email (%CTEXT;)> 43: 44: <!ELEMENT date (%CTEXT;)> 45: <!ELEMENT abstract (%CTEXT;)> 46: 47: <!-- END front definition --> 48: 49: 50: <!-- START middle definition --> 51: 52: <!-- The middle body should only contain "chapters", i.e. section1 --> 53: <!ELEMENT middle (section1)*> 54: 55: <!-- END middle definition --> 56: 57: 58: <!-- START back definition --> 59: 60: <!-- Optional back section with references --> 61: <!ELEMENT back (reference-list?)> 62: 63: <!ELEMENT reference-list (reference-item+)> 64: 65: <!ELEMENT reference-item (%text;)*> 66: <!ATTLIST reference-item 67: id ID #IMPLIED 68: > 69: 70: <!-- END back definition --> 71: 72: <!-- 73: $Log: doc.dtd,v $ 74: Revision 1.12 2003/11/19 15:12:09 just 75: many changes for invoking xbook in ant 76: 77: Revision 1.11 2003/01/06 10:27:22 just 78: removed Arial fonts from default styles 79: 80: Revision 1.10 2002/07/09 11:54:14 just 81: only comments and moving Log section to end of document. 82: 83: Revision 1.9 2002/07/05 23:56:00 just 84: introduction of page.dtd and page2html.xsl 85: 86: Revision 1.8 2002/07/04 12:45:58 just 87: made id in front section optional 88: 89: Revision 1.7 2002/06/17 15:10:38 just 90: no real chnages 91: 92: Revision 1.6 2002/04/05 12:24:47 just 93: upgrade to xalan 2.1.3 and xerces 2.0.1 94: 95: Revision 1.5 2002/03/27 20:08:26 just 96: support for html escape with xhtml tag in text.dtd and text2html.xsl 97: 98: Revision 1.4 2002/02/04 23:27:40 just 99: mainly changes to find resources through CLASSPATH (no cpath:/ anymore) 100: 101: Revision 1.3 2002/01/03 15:32:11 just 102: changes required for upgrade to Xalan 2.2D14 103: 104: Revision 1.2 2001/12/13 10:13:35 just 105: various changes 106: 107: Revision 1.1 2001/12/11 14:05:35 just 108: new 109: 110: Revision 1.3 2001/08/13 23:02:58 kstroke 111: changed to xbook/... 112: 113: Revision 1.2 2000/09/14 11:35:31 just 114: include text.dtd 115: 116: Revision 1.1 2000/08/28 00:03:54 just 117: no message 118: 119: Revision 1.1 2000/08/24 10:12:58 just 120: new 121: -->

References

[W3C]
World Wide Web Consortium. http://www.w3c.org
[W3C-XML]
World Wide Web Consortium. Extensible Markup Language (XML) 1.0. W3C Recommendation; http://www.w3.org/TR/1998/REC-xml-19980210