8.4 XML types import/export format

The schema of MetaEdit+ XML Types files is similar to that of XML Models files: a gxl tag containing graph tags. The XML namespace for the types files is http://www.metacase.com/gxlGOPRRType. Here is an overview of an XML types file:
 1  <gxl xmlns="http://www.metacase.com/gxlGOPRRType">
 2    <graph typeName="My Graph">
 3      <slot name="My Graph Name">
 4        <property typeName="Graph Name">
 5          <dataType>
 6            <simpleType>String</simpleType>
 7          </dataType>
 8        </property>
 9      </slot>
10      <object>...</object>*
11      <relationship>...</relationship>*
12      <role>...</role>*
13      <binding>
14        <relationship href="#..."/>
15        <connection>
16          <cardinality start="0" stop="N"/>
17          <role href="#..."/>
18          <object href="#..."/>
19        </connection>
20      </binding>*
21      <decomposition>...</decomposition>*
22      <explosion>...</explosion>*
23      <report>...</report>*
24      <constraints>...</constraints>
25    </graph>
26  </gxl>
In line 2, the typeName is the user-visible name of this Graph type.

Lines 3–9 define the same information as is found in one row of the properties table in the Graph Tool; this block is repeated once for each property in the graph type. Line 3 defines a property slot with local name “My Graph Name”: if the name is omitted, it is taken from the property type. Line 4 starts the definition of the property type for this slot: the name of the property type is “Graph Name”. Lines 5–7 define the data type for values of this property type, in this case String.

Lines 10–12 define the object, relationship and role types that can be in this graph type, i.e. the information found in the Graph Tool Types tab. Each of these lines can be repeated multiple times (as shown by the asterisk), and will consist of similar slot definitions to lines 3–9. The types can also contain tags specifying a symbol, as we will see below.

Lines 13–20 are an example of a binding, as would be found in the Graph Tool Bindings tab; again, this block will be repeated once for each binding. Normally, the relationship, role and object types mentioned here will be href references to types already defined earlier in the file. For the way references work, please see Section 8.2.3.

Lines 21 and 22 specify the subgraphs for this graph type, and will be described later. If a subgraph type has not been defined earlier, its definition will be included inline within these elements.

Line 23 will be repeated once for each generator – note that for backwards compatibility the old term for a generator, “report”, is used here. The generators are specified as text between <report> and </report>, with the necessary XML escape sequences. We expect most external programs will not supply generators as part of these files, adding them instead later with the Generator Editor. To avoid a new version of the metamodel deleting these generators, supplying no report elements will leave any existing generators in place. To delete all existing generators in a matching type, supply a single empty <report/> tag.