#### 24.5.7 Specifying first-child status for nested elements

To specify parent elements in which the paragraph format mapped to a given block element must appear as the first child:

    [DITAFirst]
    ; Frame para format = parents under which the current block element
    ;  (or one of its parents) must be the first child.
    Numbered1 = ol li
    Numbered = li
    Bulleted = li

If the parent element you assign to a paragraph format has more than one possible parent, and the paragraph format in question needs to be first only for one of its possible grandparents, list both the grandparent and parent, separated by spaces. You can list as many ancestors as necessary to fully specify first-child status for the paragraph format. List the ancestors in hierarchical order. The list must match the ancestor list in [DITAParents]; see §24.5.2 Designating DITA ancestor elements.

Use these settings mainly for lists, to ensure that a paragraph format starts a new list item or a new list. For example, these settings specify the following for the list paragraph formats mapped to <p> in [DITAParaTags]:

- A Numbered1 <p> element must be the first child of its parent <li> element, which <li> element must be the first child of its <ol> parent; this setting forces first-child status for the entire lineage of the elements listed, not just the last.
- A Numbered <p> element or a Bulleted <p> element must be the first child of its parent <li> element.

If you use definition lists or parameter lists, you must specify first-child status for the paragraph format of the term. For example:

    [DITAFirst]
    DefTerm = dlentry
    ParamTerm = plentry

To override the [DITAFirst] assignment for a given instance of a paragraph, place a DITAFirst PI marker in the paragraph. Make the content of the marker the name(s) of the desired ancestor element(s), in hierarchical order. A DITAFirst PI marker specifies that the current block element must be the first child of its listed ancestor elements, overriding whatever is specified in [DITAFirst].

Previous Topic: 24.5.6 Avoiding invalid ancestries

Next Topic: 24.5.8 Configuring nested lists

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.8 Configuring nested lists

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