##### 26.4.5.1 Specifying attribute values for a block element or ancestor

You can do any of the following for block elements:

Assign block element attributes

Override block element attributes

Assign interpolated parent attributes

Override interpolated parent attributes

When you want to override default or assigned attributes, keep in mind:

Where to use DocBook Attribute PI markers

Assign block element attributes

To apply attributes (other than id) to a block element (other than <xref>), assign attribute="value" pairs, separated by spaces, to the paragraph format(s) mapped to the element:

    [DocBookParaAttributes]
    ; para format (wildcards OK) = attributes
    ParaFmt = attribute1="value1" attribute2="value2" ...

You can use DITA2Go macros for any part of the assignment, or even for the entire assignment. For example:

    [DocBookParaAttributes]
    ParaFmt = <$WriteAttrMacro>

Override block element attributes

To override a setting in [DocBookParaAttributes] or to override default attributes for a particular instance of a block element, place a DocBookAttribute PI marker in a paragraph mapped to the element, with content as follows:

    elementname: attribute1="value1" attribute2="value2" ...

For example:

    step: performance="optional"

The name of the element must be followed by a colon. Separate attribute="value" pairs with a space. Each value must be enclosed in double quotes. You can use DITA2Go macros for everything after the colon.

Assign interpolated parent attributes

To assign attributes to an interpolated parent of a block element:

    [DocBookParentAttributes]
    ; para format (wildcards OK) = parentname: attributes
    ParaFmt = parentname: attribute1="value1" attribute2="value2" ...

You can use DITA2Go macros for the assignment.

Override interpolated parent attributes

To override a setting in [DocBookParentAttributes] or to override default attributes for an interpolated parent of a block element, place a DocBookAttribute PI marker in a paragraph mapped to the element, with content as follows:

    parentname: attribute1="value1" attribute2="value2" ...

To apply attributes to more than one interpolated parent, use a separate marker for each parent.

Where to use DocBook Attribute PI markers

Use DocBookAttribute PI markers only to supply attribute values other than the DTD default values for an element, or to override attribute values specified in a configuration file. Do not use DocBookAttribute PI markers for either of the following:

- The id attribute of the current element; use a DocBookElemID PI marker instead. See §26.4.4.4 Specifying an ID for an individual block element or parent.
- The id attribute of an interpolated parent of the current element; use a DocBookParentID PI marker instead. See §26.4.4.4 Specifying an ID for an individual block element or parent.

A DocBookAttribute PI marker overrides settings in [DocBookParaAttributes] and [DocBookParentAttributes], but does not override settings in [DocBookCharAttributes] (see §26.4.5.2 Specifying attribute values for an inline element).

Previous Topic: 26.4.5 Assigning attributes other than ID to DocBook elements

Next Topic: 26.4.5.2 Specifying attribute values for an inline element

Parent Topic: 26.4.5 Assigning attributes other than ID to DocBook elements

Sibling Topics:

26.4.5.2 Specifying attribute values for an inline element