Runtime components : Core components : Data elements : Concepts : References to data elements
  
References to data elements
When a data element definition can appear in more than one place in the file, you can define it once and then use a reference to that definition instead of repeating the same structure many times. To make this reference, you use the <refData> tag.
This tag is the only data element tag that can reference another tag, which can be a data field or a collection. In the following example, rather than repeat the coll1 keyed collection definition within the icoll1 definition, the icoll1 definition contains a reference to the keyed collection.
<kColl id="coll1">
  <field id="field1"/>
  <field id="field2"/>
</kColl>
<iColl id="icoll1" size="2">
  <refData refId="coll1"/>
</iColl>
By default, the reference shares the same attribute values as the original data element. You can override the default values in the reference using the <param> tag within the <refData> tag. This allows you to reuse the original definition without changing it.
It is strongly recommended that the data element definition that contains the reference is defined after the referenced data element, as shown in the above example. This is mandatory if the referenced data element in turn contains another reference, as in the following example:
<field id="field1"/>
<kColl id="coll1">
  <field id="field2"/>
  <refData refId="field1"/>
</kColl>
<iColl id="icoll1" size="2">
  <refData refId="coll1"/>
</iColl>
See also
Concepts