XML technologies / DITA / Creating and organizing topics / Task
(Excerpt from “DITA – Der neue Standard für Technische Dokumentation” by Johannes Hentrich)
Instructions telling users how to do something are among the most important information structures in technical documentation. They answer the question “How do I ...?”
Instructions provide an ideal information basis for a topic. A complete procedure delivers exactly one result: how to accomplish a task successfully. This perfectly meets the requirements of a self-contained topic.
DITA provides the task topic type (task). Its core is a list of individual action steps (steps), that is, a step-by-step procedure. The element <step> marks an individual step and specializes the element <li>, the list item element.
A task topic’s basic structure is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//ELEMENTS DITATask//EN" "../dtd/task.dtd">
<task id="kapitel8_task">
<title>Computer ausschalten</title>
<taskbody>
<steps>
<step>
<cmd>Klicken Sie auf START, um...</cmd>
</step>
</steps>
</taskbody>
</task>Like every DITA topic, a task topic begins with XML and DOCTYPE declarations. The DOCTYPE declaration references the file task.dtd, which in turn references the file task.mod, where the task topic’s elements are referenced.
The task topic type is identified by the root element <task>. The element <task> must receive a unique identifier, an ID.
The element <title> lets you assign the topic a title. The title should reflect the content of the topic as accurately as possible.
The element <taskbody> defines the task topic’s structure. In the example above, the element <taskbody> contains only one step.
A task topic can contain any number of steps (<step> elements), but only one action block, marked by the element <steps>. The elements <step> are numbered consecutively by the DITA Open Toolkit. If the individual steps should not be numbered, replace the element <steps> with the element <steps-unordered>.
The actual instruction, which the DITA language specification says should be written in direct speech, is marked by the element <cmd> (command). Incidentally, this is one of DITA’s few hints on how to phrase an element’s content.
The information in the task topic’s basic structure is hardly enough for users to perform an action successfully. DITA therefore offers numerous further elements for supplementary and more detailed procedural information:
<prereq>: this element holds all information users need before performing a task.
<taskbody>
<prereq>Um das FO-Plugin installieren zu können, benötigen Sie folgende Software...</prereq>
<steps>
...
</steps>
</taskbody><context>: this element contains brief background information about the action block, for example to explain the purpose of the procedure.
<taskbody>
<context>Wenn Sie das kleine Paket des DITA Open Toolkits installieren, benötigen Sie...</context>
</taskbody><choices>: if users can choose between several actions during a step, use the element<choices>. Each possibility is specified in a separate element<choice>.
<step>
<cmd>Wählen Sie eine Datenbank aus.</cmd>
<choices>
<choice>Wählen Sie „localhost“, wenn sich die Datenbank auf dem lokalen Server befindet.</choice>
<choice>Wählen Sie 77.12.25.124, wenn sich die Datenbank nicht auf dem lokalen Server befindet.</choice>
</choices>
</step><choicetable>: if a step offers a whole range of possibilities, list them in a table. Define the table header with the element<chhead>, the element<choptionhd>and the element<chdeschd>. The cell elements are defined with the element<chrow>, the element<choption>and the element<chdesc>. The element<choicetable>is used inside an element<step>.
<choicetable>
<chhead>
<choptionhd>Geben Sie %1 ein.</choptionhd>
<chdeschd>Diese Defaulteinstellung speichert die Datei auf dem zentralen Server.</chdeschd>
</chhead>
<chrow>
<choption>Geben Sie %2 ein.</choption>
<chdesc>Die Datei wird auf dem Backup-Server gespeichert.</chdesc>
</chrow>
<chrow>
<choption>Geben Sie %3 ein.</choption>
<chdesc>Die Datei wird lokal gespeichert.</chdesc>
</chrow>
</choicetable><info>: the element<info>supplies further information about individual steps. The element<info>is used inside an element<step>.
<taskbody>
<steps>
<step>
<cmd>Geben Sie den Dateinamen ein.</cmd>
<info>Der Dateiname darf keine Sonderzeichen enthalten.</info>
</step>
</steps>
</taskbody><substeps>: if a single step, defined by an element<step>, must be divided into substeps, use the element<substeps>. Like the element <steps>, the element<substeps>can contain several elements<substep>. Here too, the actual instructions are recorded in the element<cmd>.
<steps>
<step>
<cmd>Geben Sie die Umgebungsvariable CLASSPATH ein.</cmd>
<substeps>
<substep>
<cmd>Um eine Umgebungsvariable zu definieren, wählen Sie....</cmd>
</substep>
</substeps>
</step>
</steps><stepresult>: this element records the result of an individual step.
<taskbody>
<steps>
<step>
<cmd>Speichern Sie den Datensatz ab.</cmd>
<stepresult>Die Meldung „Datenbank wurde aktualisiert.“ wird angezeigt.</stepresult>
</step>
</steps>
</taskbody><stepxmp>: to give an example for an individual step, use the element <stepxmp>. The element<stepxmp>is used inside an element<step>.
<taskbody>
<steps>
<step>
<cmd>Geben Sie den Dateinamen ein.</cmd>
<stepxmp>Ein gültiger Dateiname ist beispielweise einfuehrung.dita.</stepxmp>
</step>
</steps>
</taskbody><result>: the element<result>records the expected result of a procedure.
<taskbody>
<result>Nachdem Sie alle Daten erfolgreich eingegeben haben, wird die Meldung „Datenbank wurde erfolgreich aktualisiert.“ angezeigt.</result>
</taskbody><tutorialinfo>:If the topic is used for a tutorial, supply further information about a step with the element<tutorialinfo>.
<taskbody>
<steps>
<step>
<cmd>Geben Sie Ihr Passwort ein.</cmd>
<tutorialinfo>Das Passwort erhalten Sie von ihrem Seminarleiter.</tutorialinfo>
</step>
</steps>
</taskbody><postreq>: if users need further steps or tasks after successfully completing the procedure, record this information in the element<postreq>.
<taskbody>
<steps>
<step>
.....
</step>
</steps>
<postreq>Als nächstes muss ANT installiert werden.</postreq>
</taskbody>
Copyright © 2008 XLcontent Verlag
You may print the online version for your private use.
Otherwise, this chapter from “DITA - Der neue Standard für Technische Dokumentation” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
XLcontent Verlag, Pflegerstraße 40, 81247 München
back to top