<taskbody>

The <taskbody> element contains the body of a task topic. The task body can include prerequisites, contextual information, steps, results, examples, troubleshooting information, and post-requisites. General task topics can also contain generic sections.

Usage information

The content model for the task topic varies depending on whether the strict task or general task document-type shell is used.

Specialization hierarchy

The <taskbody> element is specialized from <body>. It is defined in the task module.

Attributes

The following attributes are available on this element: universal attributes.

The following attributes are available on this element: universal attributes.

Examples

This section is non-normative.

This section contains examples of the <taskbody> element in both (strict) task and general task topics.

Example 1. Strict task topic

The following code sample shows how the <taskbody>element contains the main building blocks of a strict task topic:

<task id="Generating-stub-files" xml:lang="en-us">
  <title>Generating stub files</title>
  <shortdesc>You can use Task Modeler to generate stub files. Stub files are DITA files 
             that contain only a title.</shortdesc>
  <taskbody>
    <prereq>You must have created a DITA map in Task Modeler.</prereq>
    <context>As you perform this procedure, you can select the conventions that you want to 
             use for file names.</context>
    <steps>
      <!-- ... -->
    </steps>
    <result>In the File Manager view, you can see the file names and paths of the DITA
            topics.</result>
    <tasktroubleshooting>If you cannot see the file name and paths of the DITA topics, refresh
            the view.</tasktroubleshooting>
    <example> <! -- ... --> </example>
    <postreq>You now can create a relationship table to define links between the topics in 
             your DITA map.</postreq>
  </taskbody>
</task>

In a strict task topic, while the child elements of <taskbody> are all optional, they can only occur once and must appear in a specific order.

Example 2. General task topic

The following code sample shows how the <taskbody>element contains building blocks of a general task topic:

<task id="completing-group-project">
  <title>Completing the final project</title>
  <shortdesc>This handout contains information about completing the final project 
      for History 275, "Exploring your community history."</shortdesc>
  <taskbody>
    <context>The final project will account for 35% of your final grade.</context>
    <prereq>You must have an account on the college's collaboration platform.</prereq>
    <section>
      <title>Required reading</title>
      <ul>
        <li>Section 7.0 in the class course pack</li>
        <li><cite>Using Oral History in Community History Projects
            (Practices in Oral History)</cite></li>
      </ul>
    </section>
    <steps>
      <!-- ... -->
    </steps>
  </taskbody>
</task>

Note that there is more flexibility in the content model for <taskbody> in general task than there is in the strict task. In this example, <context> precedes <prereq>, and <prereq> is following by a section titled "Required reading".

Example 3. General task topic used for reuse

The following code sample shows the content of a general task topic that is used to store <prereq> elements that are reused. While the implementation uses the strict task topic for their product documentation, using a general task topic for a reuse topic enables them to have multiple <prereq> elements in a single topic.

<task id="reuse-prereq">
  <title>Reuse topic: <xmlelement>prereq</xmlelement></title>
  <shortdesc>This topic stores <xmlelement>prereq</xmlelement> elements
             that are reused in the product documentation.</shortdesc>
  <taskbody>
    <!-- ... -->
    <prereq id="sp-10">Service Pack 10 must be installed.</prereq>
    <prereq id="admin-access">You must have administrator access in order
      to perform this procedure.</prereq>
    <!-- ... -->
  </taskbody>
</task>