> For the complete documentation index, see [llms.txt](https://wfsys.gitbook.io/workflow-forms-syntax/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wfsys.gitbook.io/workflow-forms-syntax/workflow_forms/includes.md).

# Includes

## Описание Include <a href="#description_include" id="description_include"></a>

```xml
<Include Path = "IncludeDocument.xml" />
```

### Атрибуты Include <a href="#attributes_include" id="attributes_include"></a>

<table data-header-hidden><thead><tr><th align="center"></th><th width="464.3333333333333"></th></tr></thead><tbody><tr><td align="center">Path</td><td><p>Путь до xml-файла документа.</p><p></p><p>Обязательный атрибут.</p></td></tr></tbody></table>

## Описание процесса включения документов <a href="#description_include_document" id="description_include_document"></a>

Включаемый файл представляет собой xml-файл формы.

При включении производится поиск тэгов `<Include>` в блоке `<Includes>`.

Если тэги присутствуют в текущем документе, то xml-документ, указанный в атрибуте `Path`, загружается.

В загруженном документе так же производится поиск тэгов `<Include>`, тем самым поддерживается любой уровень вложенности документов.

При этом, если файл был загружен ранее, то повторно он загружен не будет.

После загрузки документа для включения все тэги внутри корневного тэга `<Forms>` копируются в вышестоятещий документ. Если в вышестоящем документе присутствует тэг, например `<DataConnections>`, то из документа-включения копируются тэги внутри `<DataConnections>` в тэг `<DataConnections>` вышестоящего документа.

### Пример простого включения документа <a href="#include_document_example_1" id="include_document_example_1"></a>

Файл Form1.xml

```xml
<Forms>
  <Includes>
    <Include Path="Form2.xml" />
  </Includes>
  <MyObjects>
    <MyObject Name="Panel" Type="Panel" Assembly="BaseControls"></MyObject>
  </MyObjects>
</Forms>
```

Файл Form2.xml

```xml
<Forms>
  <Appearance>
    <Colors>
      <Color Name="Red" Red="255" Green="0" Blue="0" Alpha="255" />
    </Colors>
  </Appearance>
  <MyObjects>
    <MyObject Name="Panel2" Type="Panel" Assembly="BaseControls"></MyObject>
  </MyObjects>
</Forms>
```

Итоговый документ после включения Form2.xml в Form1.xml

```xml
<Forms>
  <Includes>
    <Include Path="Form2.xml" />
  </Includes>
  <Appearance>
    <Colors>
      <Color Name="Red" Red="255" Green="0" Blue="0" Alpha="255" />
    </Colors>
  </Appearance>
  <MyObjects>
    <MyObject Name="Panel" Type="Panel" Assembly="BaseControls"></MyObject>
    <MyObject Name="Panel2" Type="Panel" Assembly="BaseControls"></MyObject>
  </MyObjects>
</Forms>
```

### Пример включения документов с вложенными документами <a href="#include_document_example_2" id="include_document_example_2"></a>

Файл Form1.xml

```xml
<Forms>
  <Includes>
    <Include Path="Form2.xml" />
  </Includes>
  <MyObjects>
    <MyObject Name="Panel" Type="Panel" Assembly="BaseControls"></MyObject>
  </MyObjects>
</Forms>
```

Файл Form2.xml

```xml
<Forms>
  <Includes>
    <Include Path="Form3.xml" />
  </Includes>
  <MyObjects>
    <MyObject Name="Panel2" Type="Panel" Assembly="BaseControls"></MyObject>
  </MyObjects>
</Forms>
```

Файл Form3.xml

```xml
<Forms>
  <Appearance>
    <Colors>
      <Color Name="Red" Red="255" Green="0" Blue="0" Alpha="255" />
    </Colors>
  </Appearance>
</Forms>
```

Итоговый документ после включения Form3.xml в Form2.xml, который был включен в Form1.xml

```xml
<Forms>
  <Includes>
    <Include Path="Form2.xml" />
  </Includes>
  <Appearance>
    <Colors>
      <Color Name="Red" Red="255" Green="0" Blue="0" Alpha="255" />
    </Colors>
  </Appearance>
  <MyObjects>
    <MyObject Name="Panel" Type="Panel" Assembly="BaseControls"></MyObject>
    <MyObject Name="Panel2" Type="Panel" Assembly="BaseControls"></MyObject>
  </MyObjects>
</Forms>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wfsys.gitbook.io/workflow-forms-syntax/workflow_forms/includes.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
