#### 24.5.8 Configuring nested lists

If your document includes nested ordered or unordered lists (or a mix of the two), it is best to specify a set of ancestor elements that includes both; see §24.5.5 Specifying alternate ancestries for the same element. For example:

    [DITAElementSets]
    $list= ol ul

This particular element set is predefined in the starting configuration file for DITA output. Specifying $list as an ancestor lets you have bullets subordinate to either bulleted or numbered items, and vice-versa:

In your list items you must use <li><p>, not just <li>, because the nested <ul> needs to be inside the <li>, and the smallest enclosing tag always closes at the end of the paragraph (to prevent “pernicious mixed content” wherever possible). This way, the <p> closes, but the <li> stays open for the nested list.

Suppose your document includes a hierarchy of paragraph formats like this:

    Body
      Bulleted
        BulletedSub
        BulletedSub
      Bulleted
        BulletedSub
        BulletedSub
        BulletedSub
    Body

You would specify the following settings for the bulleted items:

    [DITAParaTags]
    Bulleted = p
    BulletedSub = p

    [DITAParents]
    Bulleted = $text ul li
    BulletedSub = $text $list li ul li

    [DITAFirst]
    Bulleted = li
    BulletedSub = li

Note: Do not try to use DITA levels to nest lists.

Previous Topic: 24.5.7 Specifying first-child status for nested elements

Next Topic: 24.5.9 Closing DITA ancestor elements

Parent Topic: 24.5 Nesting DITA block elements

Sibling Topics:

24.5.1 Understanding how DITA2Go determines element nesting

24.5.2 Designating DITA ancestor elements

24.5.3 Fixing up interpolated ancestries

24.5.4 Deciding when to fully specify ancestry

24.5.5 Specifying alternate ancestries for the same element

24.5.6 Avoiding invalid ancestries

24.5.7 Specifying first-child status for nested elements

24.5.9 Closing DITA ancestor elements

24.5.10 Opening DITA ancestor elements

24.5.11 Configuring multi-paragraph list items

24.5.12 Specifying DITA element levels

Table of Contents • Index