5. Splitting up a CPACS dataset into several files

To provide a better overview, it is possible to split up a CPACS dataset into several files. This can be done by inserting an <externaldata> node at an arbitrary position into the dataset. This node contains a <path> node with a URI to the external file(s), followed by one or more <filename> nodes, containing each a name of a file to be included at that position. Below, an example of such external data is given:

<?xml version="1.0" encoding="utf-8"?>
<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd">
    <vehicles>
        <profiles>
            <wingAirfoils>
                <externaldata>
                    <path>file://airfoils</path>
                    <filename>NACA0010.xml</filename>
                    <filename>NACA2412.xml</filename>
                </externaldata>
                <airfoil uID="NACA0012">
                    <name>NACA 0012 Airfoil</name>
                    <pointList>...</pointList>
                </airfoil>
            </wingAirfoils>
        </profiles>
    </vehicles>
</cpacs>
Linking external data

Such an external file would look like:

<?xml version="1.0" encoding="utf-8"?>
<airfoil uID="NACA0010">
    <name>NACA 0010 Airfoil</name>
    <pointList>...</pointList>
</airfoil>
External data for linking in CPACS

The file would be included completely, except for its title line <?xml version="1.0" encoding="utf-8"?>. This concept can also be used recursively (external files of external files), but it is important to prevent circle connections (file "A" loading file "B" loading file "C" loading again file "A" ...).

For path URI addresses, the trailing file separator "/" may be omitted. Below, some examples for path URIs are given:

With the help of the TiXI XML Interface TiXI , a CPACS dataset that is split into multiple files can be reassembled into a single tree structure for subsequent validation against the CPACS schema. The following commands are used to link external data sets:

The merged data tree for the example above would look like:

<?xml version="1.0" encoding="utf-8"?>
<cpacs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="pathToSchemaFile/cpacs_schema.xsd">
    <vehicles>
        <profiles>
            <wingAirfoils>
                <airfoil uID="NACA0010" externalFileName="NACA0010.xml" externalDataDirectory="file://airfoils" externalDataNodePath="/cpacs/vehicles/profiles/wingAirfoils">
                    <name>NACA 0010 Airfoil</name>
                    <pointList>...</pointList>
                </airfoil>
                ...
                <airfoil uID="NACA0012">
                    <name>NACA 0012 Airfoil</name>
                    <pointList>...</pointList>
                </airfoil>
            </wingAirfoils>
        </profiles>
    </vehicles>
</cpacs>
External data merged into the main dataset using TiXI