How are steps and substeps structured in a task topic?

Structuring steps and substeps within a task topic is a fundamental aspect of creating clear and well-organized documentation in DITA XML. This structured approach ensures that procedures and instructions are presented in a systematic and comprehensible manner, facilitating the execution of tasks. Here’s an overview of how steps and substeps are typically structured in a task topic in DITA XML.

Steps

In a DITA task topic, the main steps are typically structured using the <steps> element. Each individual step within a task is represented by the <step> element. Steps provide a clear and concise description of what needs to be done. They are often numbered or ordered to guide the reader through the task sequentially. Steps can be as simple as a single action or can encompass multiple actions or substeps.

Substeps

Substeps are used when a step within a task contains further details or subtasks that need to be performed. Substeps are structured using the <substeps> element. Within the <substeps>, you can use the <substep> element to break down the step into smaller, more manageable actions. This hierarchical approach allows for a clear and organized representation of complex tasks.

Example:

Here’s an example of how steps and substeps are structured in a DITA XML task topic:


<steps>
  <step>Prepare the work area.</step>
  <step>Mix the ingredients thoroughly.</step>
  <step>Cook the dish for 30 minutes.</step>
  <step>Cool it down before serving.</step>
  <step>Review the final presentation.</step>
  <substeps>
    <substep>Check the seasoning.</substep>
    <substep>Adjust the garnish.</substep>
  </substeps>
</steps>

In this example, a cooking task includes main steps, such as preparation, mixing, cooking, cooling, and review. The “Review” step contains substeps for checking the seasoning and garnish, providing a structured approach to completing the task.