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:
<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>Such an external file would look like:
<airfoil uID="NACA0010">
<name>NACA 0010 Airfoil</name>
<pointList>...</pointList>
</airfoil> 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:
file:///tmp or file:///c:/windows/tmp file://relativeDirectory or file://../anotherRelativeDirectory http://www.someurl.de 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:
externalFileName: Name of the external data file externalDataDirectory: Directory of the external data file. Its content is analogous to the <externaldata/path> element described above. externalDataNodePath: XPath of the node which is replaced with the content of the external file. In case that it is an external file of an external file, then it is the XPath in the outer external file. If, e.g., in the example above the <pointList> element would have also been loaded from an external file, then the entry would just be:externalDataNodePath="/airfoil". This is used primarily for loop-detection. The merged data tree for the example above would look like:
<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>