# Adding support for xi:include

**URL:** https://discourse.paraview.org/t/adding-support-for-xi-include/2159
**Category:** Development
**Created:** [July 3, 2019, 2:41pm UTC](https://discourse.paraview.org/t/adding-support-for-xi-include/2159 "2019-07-03T14:41:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 3, 2019, 2:41pm UTC](https://discourse.paraview.org/t/adding-support-for-xi-include/2159/1 "2019-07-03T14:41:13Z")

</div>

The ParaView ServerManager configuration XML have grown to be quite complex over the years. To avoid duplication we came up with some idiosyncratic strategies in the past like `base_xmlgroup`, `base_xmlname` etc. I am wondering if it’s time to add something more standard-esque like `xi::inlcude`.

In my use-case, I am adding support for bunch of writers to choose arrays to write. Currently, I’ll have to resort to copy-paste, however with xi:include, it could be potentially supported as follows:

```xml
<ServerManagerConfiguration>
  <Stub name="ArraySelectionForWriters">
    <!-- define a stub to re-use -->
     <SubProxy>
        <Proxy name="PassArrays" proxygroup="internal_writers" proxyname="PassArrays" />
        <ExposedProperties>
          <Property name="ChooseArraysToWrite"/>
          <PropertyGroup label="Array Selection" panel_widget="ArrayStatus">
            <Property name="PointDataArrays" />
            <Property name="CellDataArrays" />
            <Property name="FieldDataArrays" />
            <Property name="VertexDataArrays" />
            <Property name="EdgeDataArrays" />
            <Property name="RowDataArrays" />
          </PropertyGroup>
        </ExposedProperties>
        <LinkProperties>
          <Property name="Input" with_property="Input" />
        </LinkProperties>
     </SubProxy>
  </Stub>

  ....
  <WriterProxy ...>
    <StringVectorProperty name="FileName" .. >
     </StringVectorProperty>
       ...
      <!-- this is same as having the Stub/SubProxy element copied here -->
      <xi::include xpointer="element(//Stub[@name='ArraySelectionForWriters']/SubProxy)" />
  </WriterProxy>

</ServerManagerConfiguation>

```

Thoughts? Other suggestions?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 5, 2019, 10:47am UTC](https://discourse.paraview.org/t/adding-support-for-xi-include/2159/2 "2019-07-05T10:47:42Z")

</div>

+1, but we would need to take a pass into the existing xml in order to use the stub feature when possible.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 5, 2019, 1:15pm UTC](https://discourse.paraview.org/t/adding-support-for-xi-include/2159/3 "2019-07-05T13:15:32Z")

</div>

> [@mwestphal](#):
>
> but we would need to take a pass into the existing xml in order to use the stub feature when possible.

yes indeed. If we do adopt this, we may also want to get rid of the `base_xmlgroup`, `base_xmlname` mechanisms as they are confusing to say the least.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [July 8, 2019, 7:41am UTC](https://discourse.paraview.org/t/adding-support-for-xi-include/2159/4 "2019-07-08T07:41:25Z")

</div>

unless we find a very smart way to be retro compatible, this will break lots of plugin and paraview based code.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [July 8, 2019, 7:47pm UTC](https://discourse.paraview.org/t/adding-support-for-xi-include/2159/5 "2019-07-08T19:47:50Z")

</div>

I’m sure we can put together a simple Python-based XML conversion tool.
