How is a list created in DITA XML?
In DITA, lists are created to present information in a structured and organized manner. Lists can be used to convey sequences, items, or concepts in a clear and easily digestible format. DITA supports two main types of lists: ordered lists (numbered lists) and unordered lists (bulleted lists). Lists may also be nested, or placed inside other lists.
Ordered Lists (Numbered Lists):
Overview: Ordered lists are used to present items or steps in a sequential or numbered order. They are commonly used for procedures, instructions, or any content that requires a specific order of presentation.
DITA Markup: To create an ordered list in DITA, the <ol> (ordered list) element is used. Each list item is represented by the <li> (list item) element. The @type attribute is used to specify the numbering style (e.g., decimal, uppercase letters, lowercase roman numerals).
<ol>
<li>Start the computer.</li>
<li>Open the software application.</li>
<li>Load the project file.</li>
<!-- Additional list items continue... -->
</ol>
Unordered Lists (Bulleted Lists):
Overview: Unordered lists are used to present items or concepts without a specific order. They are typically represented as bulleted lists, making them suitable for listing items, features, or concepts that are not necessarily sequential.
DITA Markup: To create an unordered list in DITA, the <ul> (unordered list) element is used. Like ordered lists, each list item is represented by the <li> (list item) element.
<ul>
<li>Apples</li>
<li>Oranges</li>
<li>Bananas</li>
<!-- Additional list items continue... -->
</ul>
Nested Lists:
Overview: DITA allows nesting lists within lists. This is useful to create a hierarchy of information or to combine ordered and unordered lists within the same content.
DITA Markup: To create nested lists, simply embed one <ol> or <ul> element within another <li> element.
<ul>
<li>Fruits
<ul>
<li>Apples</li>
<li>Oranges</li>
<li>Bananas</li>
</ul>
</li>
<li>Vegetables
<ul>
<li>Carrots</li>
<li>Broccoli</li>
<li>Spinach</li>
</ul>
</li>
</ul>