Adding support for xi:include

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:

<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?

1 Like

+1, 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.

1 Like

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

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

1 Like