1. Introduction
4.1. The concept element
4.2. The task element
5. Topic maps
5.1. The map element
5.2. The bookmap element
6. Conclusion

<topic id="docbook_or_dita">
<title>DITA or DocBook?</title>
<shortdesc>Both DITA and DocBook are both mature, feature rich, document types,
so which one to choose?</shortdesc>
<body>
<p>DocBook 5 is a mature document type, well-documented (DocBook: The
Definitive Guide, DocBook XSL: The Complete Guide), coming with decent XSL
stylesheets allowing to convert it to a variety of formats, based on the
best schema technologies: RELAX NG and Schematron.</p>
<p>DITA concepts (topics, maps, specialization, etc) have an immediate
appeal to the technical writer and indeed, makes this document type more
attractive than DocBook. However the DocBook vocabulary is comprehensive
and very well thought. So choose DITA if its standard vocabulary is
sufficiently expressive for your needs or if, anyway, you intend to
specialize DITA.</p>
</body>
<related-links>
<link format="html" href="http://www.docbook.org/" scope="external">
<linktext>DocBook 5</linktext>
</link>
<link format="html"
href="http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=dita"
scope="external">
<linktext>DITA</linktext>
</link>
</related-links>
</topic>Both DITA and DocBook are both mature, feature rich, document types, so which one to choose?
<ul>
<li>First item.
<p>Continuation paragraph.</p>
</li>
<li>Second item. This item contains an ordered list.
<ol>
<li>First do this.</li>
<li>Then do that.</li>
<li>Finally do this.</li>
</ol>
</li>
<li>Third item. This item contains a variable list.
<dl>
<dlentry>
<dt>Term #1</dt>
<dd>Definition of term #1.</dd>
</dlentry>
<dlentry>
<dt>Term #2</dt>
<dd>Definition of term #2.</dd>
</dlentry>
</dl>
</li>
</ul><section>
<title>The customary “hello word” program in Tcl/Tk</title>
<pre frame="all">button .hello -text "Hello, World!" -command { exit }
pack .hello</pre>
</section>button .hello -text "Hello, World!" -command { exit }
pack .hello<example>
<title>Converting a color image to black and white</title>
<pre>$ convert -dither Floyd-Steinberg -monochrome photo.png bwphoto.gif</pre>
<fig>
<title>The photo converted to black and white</title>
<image href="bwphoto.gif" align="center"/>
</fig>
</example>$ convert -dither Floyd-Steinberg -monochrome photo.png bwphoto.gif

<simpletable relcolwidth="1* 2* 3*">
<sthead>
<stentry>A</stentry>
<stentry>B</stentry>
<stentry>C</stentry>
</sthead>
<strow>
<stentry>A,1</stentry>
<stentry>B,1</stentry>
<stentry>C,1</stentry>
</strow>
<strow>
<stentry>A,2</stentry>
<stentry>B,2</stentry>
<stentry>C,2</stentry>
</strow>
</simpletable>| A | B | C |
|---|---|---|
| A,1 | B,1 | C,1 |
| A,2 | B,2 | C,2 |
<table>
<title>Sample CALS table</title>
<tgroup cols="3">
<colspec colwidth="1*"/>
<colspec colwidth="2*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry align="center">A</entry>
<entry align="center">B</entry>
<entry align="center">C</entry>
</row>
</thead>
<tbody>
<row>
<entry>A,1</entry>
<entry>B,1</entry>
<entry>C,1</entry>
</row>
<row>
<entry>A,2</entry>
<entry>B,2</entry>
<entry>C,2</entry>
</row>
</tbody>
</tgroup>
</table>| A | B | C |
|---|---|---|
| A,1 | B,1 | C,1 |
| A,2 | B,2 | C,2 |
<xref href="topic_structure.dita"/>
<xref href="http://www.xmlmind.com/xmleditor/"
format="html"
scope="external">XMLmind XML Editor</xref>
<link href="samples/sample_topic.dita#docbook_or_dita"/>
<link href="http://www.xmlmind.com/ditac/"
format="html"
scope="external">
<linktext>XMLmind DITA Converter</linktext>
</link><topic id="t1">
<title>Title of topic 1</title>
<body>
<p id="p1">Paragraph inside topic 1.</p>
<p>More information in <xref href="???"/>.</p>
</body>
</topic><topic id="t2">
<title>Title of topic 2</title>
<body>
<p id="p2">Paragraph inside topic 2.</p>
</body>
</topic><p>More information in <xref href="topic2.dita"/>.</p>
<p>More information in <a href="page-23.html#t2">Title of topic 2</a>.</p>
<xref href="topic2.dita#t2/p2"/>
<xref href="topic2.dita#t2/p2">this paragraph</xref>

<concept id="what_is_a_cache">
<title>What is a cache?</title>
<shortdesc>Everything you'll ever need to know about
<term>cache</term>s.</shortdesc>
<conbody>
<p>In computer science, a cache is a temporary storage area where
frequently accessed data can be stored for rapid access.</p>
</conbody>
<related-links>
<link format="html" href="http://en.wikipedia.org/wiki/Cache"
scope="external">
<linktext>Wikipedia definition of a cache</linktext>
</link>
</related-links>
</concept>Everything you'll ever need to know about caches.
<task id="install_emacs">
<title>Installing GNU Emacs</title>
<taskbody>
<prereq>Windows NT 4.0 or any subsequent version of Windows. 5Mb of free
disk space.</prereq>
<steps>
<step>
<cmd>Unzip the distribution anywhere.</cmd>
<info>We recommend to use the free, open source, <xref format="html"
href="http://www.info-zip.org/" scope="external">Info-ZIP</xref>
utility to do so.</info>
<stepxmp><screen>C:\> unzip emacs-21.3-bin-i386.zip</screen></stepxmp>
<stepresult><p>Doing this will create an
<filepath>emacs-21.3</filepath> directory.</p></stepresult>
</step>
<step>
<cmd>Go to the bin subdirectory.</cmd>
<stepxmp><screen>C:\> cd emacs-21.3\bin</screen></stepxmp>
</step>
<step>
<cmd>Run <cmdname>addpm</cmdname>.</cmd>
<stepxmp><screen>C:\emacs-21.3\bin> addpm</screen></stepxmp>
<stepresult>A confirmation dialog box is displayed.<fig>
<image href="confirm_install_emacs.png"/>
</fig></stepresult>
</step>
<step>
<cmd>Click <uicontrol>OK</uicontrol> to confirm.</cmd>
</step>
</steps>
</taskbody>
</task>C:\> unzip emacs-21.3-bin-i386.zip
C:\> cd emacs-21.3\bin
C:\emacs-21.3\bin> addpm

<reference id="pwd_command">
<title>The <cmdname>pwd</cmdname> command</title>
<refbody>
<refsyn><cmdname>pwd</cmdname></refsyn>
<section><title>DESCRIPTION</title><p>Print the full filename of the
current working directory.</p><note>Your shell may have its own version of
<cmdname>pwd</cmdname>, which usually supersedes the version described
here.</note></section>
<section><title>AUTHOR</title><p>Written by John Doe. </p></section>
</refbody>
<related-links>
<link format="html" href="http://www.manpagez.com/man/3/getcwd/"
scope="external">
<linktext><cmdname>getcwd</cmdname>(3)</linktext>
</link>
</related-links>
</reference><glossgroup id="sample_glossary">
<title>Sample glossary</title>
<glossentry id="ajax">
<glossterm>AJAX</glossterm>
<glossdef><b>A</b>synchronous <b>Ja</b>vaScript and <b>X</b>ML. Web
development techniques used on the client-side to create interactive web
applications.</glossdef>
</glossentry>
<glossentry id="dhtml">
<glossterm>DHTML</glossterm>
<glossdef><b>D</b>ynamic <b>HTML</b>. Web development techniques used on
the client-side to create interactive web sites.</glossdef>
</glossentry>
<glossentry id="javascript">
<glossterm>JavaScript</glossterm>
<glossdef>JavaScript is an object-oriented scripting language supported by
all major web browsers. It allows the development of interactive web sites
and web applications.</glossdef>
<related-links>
<link format="html" href="https://developer.mozilla.org/en/JavaScript"
scope="external">
<linktext>Mozilla's Official Documentation on JavaScript</linktext>
</link>
</related-links>
</glossentry>
</glossgroup><topicref href="samples/sample_glossary.dita"/>
<topicref href="samples/sample_glossary.dita#javascript"/>
<topicref href="topic.dita">
<topicref href="topic_structure.dita">
<topicref href="samples/sample_topic.dita"/>
</topicref>
<topicref href="block_elements.dita"/>
<topicref href="inline_elements.dita"/>
<topicref href="link_elements.dita"/>
</topicref><map>
<title>DITA for the Impatient</title>
<topicmeta>
<author>Hussein Shafie</author>
<publisher>Pixware</publisher>
<critdates>
<created date="October 7, 2009"/>
</critdates>
</topicmeta>
<topicref href="introduction.dita"/>
<topicref href="topics_and_maps.dita"/>
<topicref href="topic.dita">
<topicref href="topic_structure.dita">
<topicref href="samples/sample_topic.dita" toc="no"/>
</topicref>
<topicref href="block_elements.dita"/>
<topicref href="inline_elements.dita"/>
<topicref href="link_elements.dita"/>
</topicref>
.
.
.
<topichead navtitle="Topic maps">
<topicref href="map.dita"/>
<topicref href="bookmap.dita"/>
</topichead>
<topicref href="conclusion.dita"/>
</map> <topicref href="topic_structure.dita">
<topicref href="samples/sample_topic.dita" toc="no"/>
</topicref><bookmap>
<booktitle>
<mainbooktitle>DITA for the Impatient</mainbooktitle>
</booktitle>
<bookmeta>
<authorinformation>
<personinfo>...</personinfo>
<organizationinfo>...</organizationinfo>
</authorinformation>
<critdates>
<created date="October 7, 2009"/>
</critdates>
</bookmeta>
<frontmatter>
<booklists>
<toc/>
<figurelist/>
<tablelist/>
</booklists>
</frontmatter>
<chapter href="introduction.dita"/>
<chapter href="topics_and_maps.dita"/>
<chapter href="topic.dita">
<topicref href="topic_structure.dita">
<topicref href="samples/sample_topic.dita" toc="no"/>
</topicref>
<topicref href="block_elements.dita"/>
<topicref href="inline_elements.dita"/>
<topicref href="link_elements.dita"/>
</chapter>
.
.
.
<chapter navtitle="Topic maps">
<topicref href="map.dita"/>
<topicref href="bookmap.dita"/>
</chapter>
<chapter href="conclusion.dita"/>
</bookmap>| (1) | Preferably using a DITA-aware XML editor such as XMLmind XML Editor Personal Edition (free to use). |
| (2) | The body element is optional too. However creating a topic element having no body child element is mainly a trick which is more simply implemented by adding a topichead to a map. |
| (3) | More about topic maps later in this tutorial. |
| (4) | A less convenient alternative would be to use an actual topic having no body at all, just a title. |