Open topic with navigation

# _INCLUDE

The `_INCLUDE` element is used to include XML elements from elsewhere in the `DocumentsXML` file.

The included elements can be considered to replace the `_INCLUDE` element.

The `_INCLUDE` element can be used recursively provided that it is used to process a terminating sequence of relationships. _INCLUDE elements can be processed to a maximum depth of 32 inclusions.

Attribute | Description
--- | ---
`xpath` | An XPATH expression that is evaluated relative to this `_INCLUDE` element. The result of the expression must be a set of XML elements.
Other attributes | Other attributes that are not reserved can be used to replace values in the included XML. The attribute names identify the string to be replaced. The name should be unique and chosen to target only the desired text. The attribute values specify the replacement text. You can replace any attribute value, custom attribute name, custom element name or element content.

## Example

The following example demonstrates use of the `_INCLUDE` element, and shows how to replace the value of the `relation_name` attribute in the included XML.

    <DOCUMENTS>
       <DOCUMENT ...>
          <mydoc>
             <obj_attrs>
                ...
             </obj_attrs>
             <_INCLUDE xpath="/DOCUMENTS/RELATION/*" _REL_NAME_="Manufacturing Responsibility"/>
          </mydoc>
       </DOCUMENT>

       <RELATION>
          <_TO_REL rel_pattern="_REL_NAME_" node_name="relation" relation_name="_REL_NAME_">
             <rel_attrs>
                ...
             </rel_attrs>
          </_TO_REL>
       </RELATION>
    </DOCUMENTS>

Result

The following XML is created in the indexed document:

    <mydoc>
       <obj_attrs>
          ...
       </obj_attrs>
       <relation>
          <relation_name>Manufacturing Responsibility</relation_name>
          <rel_attrs>
          ...
          </rel_attrs>
       </relation>
    </mydoc>

© 2018 Micro Focus or one of its affiliates | Send documentation feedback to Micro Focus Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm