##### 3.2.2.1 task

The <task> element is the top-level element for a task topic. Tasks are the main building blocks for task-oriented user assistance. They generally provide step-by-step instructions that will enable a user to perform a task. A task answers the question of "how to?" by telling the user precisely what to do and the order in which to do it. Tasks have the same high-level structure as other topics, with a title, short description and body.

Beginning with DITA 1.2, there are two task models available in the DTD and Schema packages distributed by OASIS. One model, referred to as the general task, allows two additional elements inside the task body (<section> and <steps-informal>); it also allows multiple instances and orders for each element within <taskbody>. The second model, referred to as the strict task, maintains the order and cardinality of the DITA 1.0 and 1.1 taskbody. This strict task is implemented in the DTD and Schema with a constraint module.

See the taskbody description for additional details about the two models and for a description of impacts to DITA 1.1 documents.

###### Contains

Doctype | Content model
ditabase | ( (title) then (titlealts) (optional) then (abstract or shortdesc) (optional) then (prolog) (optional) then (taskbody) (optional) then (related-links) (optional) then (topic or concept or task or reference or glossentry or glossgroup) (any number) )
task, machineryTask | ( (title) then (titlealts) (optional) then (abstract or shortdesc) (optional) then (prolog) (optional) then (taskbody) (optional) then (related-links) (optional) then (task) (any number) )
learningContent | ( (title) then (titlealts) (optional) then (abstract or shortdesc) (optional) then (prolog) (optional) then (taskbody) (optional) then (related-links) (optional) then ( (no-topic-nesting) (optional) ) (any number) )

###### Contained by

Doctype | Content model
ditabase | dita, topic, concept, task, reference
task (strict), task (general), machineryTask | task
learningContent | learningContent

###### Inheritance

- topic/topic task/task

###### Example

    <task id="sqlj">
     <title>Creating an SQLJ file</title>
     <taskbody>
      <context>Once you have set up SQLJ, you need to create a new SQLJ file.
      </context>
      <steps>
       <step><cmd>Open...</cmd></step>
      </steps>
     </taskbody>
    </task>

###### Attributes

Name | Description | Data Type | Default Value | Required?
id | This ID enables topics to be referenced uniquely by topicrefs in DITA maps. | ID |  | Yes
conref-atts attribute group (conref, conrefend, conaction, conkeyref) | A set of related attributes; includes all of the attributes described in 3.4.1.4 id-atts attribute group except for the id attribute. |  |  |
xmlns:ditaarch | Declares the default DITA namespace. |  | "http://dita.​oasis-open.​org/​architecture/​2005/" |
DITAArchVersion | Designates the version of the architecture that is in use. The default value will increase with each release of DITA. | CDATA | "1.2" | No
domains | Indicates the specialized domains that are included in the DTD or Schema. This value will differ depending on what domains are included in the current DTD or Schema. | CDATA | Varies based on the DTD or Schema; a sample value is "(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic indexing-d)" | No
select-atts attribute group (props, base, platform, product, audience, otherprops, importance, rev, status) | A set of related attributes, described in 3.4.1.5 select-atts attribute group |  |  |
localization-atts attribute group (translate, xml:lang, dir) | A set of related attributes, described in 3.4.1.6 localization-atts attribute group. |  |  |
global-atts attribute group (xtrf, xtrc) | A set of related attributes, described in 3.4.1.2 global-atts attribute group |  |  |
class, outputclass | Common attributes described in 3.4.1.9 Other common DITA attributes |  |  |

Previous Topic: 3.2.2 Task elements

Next Topic: 3.2.2.2 taskbody

Parent Topic: 3.2.2 Task elements

Sibling Topics:

3.2.2.2 taskbody

3.2.2.3 prereq

3.2.2.4 context

3.2.2.5 steps

3.2.2.6 steps-informal

3.2.2.7 steps-unordered

3.2.2.8 step

3.2.2.9 stepsection

3.2.2.10 cmd

3.2.2.11 info

3.2.2.12 substeps

3.2.2.13 substep

3.2.2.14 stepxmp

3.2.2.15 choicetable

3.2.2.16 chhead

3.2.2.17 choptionhd

3.2.2.18 chdeschd

3.2.2.19 chrow

3.2.2.20 choption

3.2.2.21 chdesc

3.2.2.22 choices

3.2.2.23 choice

3.2.2.24 stepresult

3.2.2.25 tutorialinfo

3.2.2.26 result

3.2.2.27 postreq