### 41.5 Understanding how DITA2Go uses content models

Where there are multiple possible parent elements of a given DITA XML element, a set is defined for those parent elements in the [ElementSets] section of the content model configuration file; see §41.1 Understanding DITA2Go content models. The *Part N sets in this section are computer generated to keep the lengths of the individual sets short enough to be editable; they have no other special purpose. Within each set, elements are listed alphabetically for convenience in human look-up.

For example:

    [TopicParents]
    data=data=*data

    [ElementSets]
    *data=data-about *Part2 *Part6 *Part9 *Part10
     . . .
    *Part2=b cite codeblock codeph data i lq note p ph pre q screen shortdesc sub sup title tt u xref
     . . .
    *Part6=abstract dd ddhd desc draft-comment dt dthd entry example fn itemgroup li lines linkinfo pd pt section sli stentry
     . . .
    *Part9=alt author brand category copyrholder filepath index-base index-see index-see-also index-sort-as indexterm msgblock msgph prodname publisher source systemoutput uicontrol userinput
     . . .
    *Part10=body component coords delim featnum fig fragref linktext metadata navtitle oper platform prognum prolog repsep searchtitle sep series var

DITA2Go uses a complex algorithm to determine which element to interpolate in places in your document where a parent element is required. When DITA2Go processes your document and encounters text that you have mapped to a <data> element (for example), DITA2Go searches the above element sets, in sequence, for the current parent element. If the parent is not found, DITA2Go performs a graph analysis, breadth-first, of possible parent series that could fit under the current parent. In each case, DITA2Go takes the first of those candidate parents with equal-length sequences and interpolates it between the <data> element and its current parent.

This means that you could change the usage priority of interpolated parents by altering the order of items in a content-model element set. (The full collection of algorithms is rather more complex; for example, DITA2Go also considers closing existing parents to find a better solution to the graph problem.)

Suppose you want to tell DITA2Go not to use certain elements; for example, “forget about <data>” or “never use <fn> in a <fig>”. If you delete data from all element sets, this element will never be interpolated into your DITA XML output. If you delete fig from all element sets that contain possible parents of fn, fig will never be interpolated as a parent of fn. However, we advise not adding or removing any items, because doing so can result in invalid DITA XML. (Removal is safer than addition.)

Previous Topic: 41.4.5 Content model [TopicLevels] settings

Next Topic: 41.6 Inspecting and correcting element types

Parent Topic: 41. Working with content models

Sibling Topics:

41.1 Understanding DITA2Go content models

41.2 Modifying or replacing a content model

41.3 Preparing a content model for use with DITA2Go

41.4 Understanding content-model configurations

41.6 Inspecting and correcting element types

41.7 Specializing or modifying DITA topic types

41.8 Extracting content-model debug information