Tag in context

All mappings must declare a context. In the simplest case, the context identifies the name of the tag or custom marker being mapped.

A more specific mapping context may be required if you need to disambiguate mappings that share the same attribute or occurrence qualifier. In this case, the context path defines the position of the tag in the document hierarchy, with the names of ancestor tags separated by either / (parent of) or // (ancestor of). The last element in the path is the name of the tag being mapped.

For example:

  • chapter/title — maps a title element immediately inside a chapter;

  • chapter//title — maps a title element anywhere inside a chapter;

  • chapter//part/title — maps a title element immediately inside a part element which is itself anywhere inside a chapter element;

  • title — maps a title element anywhere within the document.

For a custom mapping the last (or only) component of the path starts with %.

When there are multiple mappings with contexts that match an element the mapping with highest precedence is chosen. See “Priority and Precedence” for details.

If DITA mode is enabled the meaning of names in the path is extended to include elements that inherit from the named element. See the User Guide for more information.

Some tags used within tables cannot have mappings as described in “Mapping CALS table tags” and “Mapping HTML table tags”.