DEF Lines

The DEF lines control the generation of the GML application schema. The syntax of a GML DEF line is:

<WriterKeyword>_DEF <feature type> \ 
	[<attribure name> <attribute type>]*

Where the valid values for <attribute type> are: xml_char(width), xml_int32, xml_real32, xml_decimal(width,decimal), xml_boolean, and xml_real64.

The <attribute name> can either be a simple attribute, a list attribute, or a structured attribute.

Simple attributes have no embedded period, and they are mapped into simple type properties in the GML application schema. List attributes end with a “{}” suffix, and are mapped into simple type property declarations whose maxOccurs are set to unbounded.

Structured attributes have embedded periods, each component in a structured attribute is separated by a period, and each component may also be a list. Structured attributes are mapped into complex type properties in the GML application schema. For example, the structured FME attributes, “changeHistory.Date”, and “changeHistory.Reason” are mapped into a changeHistory element whose complex type is defined as a sequence of Date and Reason elements both of which are defined as simple types.

For example, the DEF line:

GML_DEF F1 \
	code xml_int32	\
	changeHistory.Date xml_char(10)	\
	changeHistory.Reason  xml_char(254)

Generates the following complex type definition:

<complexType name="F1Type">
   <complexContent>
      <extension base="gml:AbstractFeatureType">
         <sequence>
            <element name="code" minOccurs="0" type="integer"/>
            <element name="changeHistory" minOccurs="0">
               <complexType>
                  <sequence>
                     <element name="Date" minOccurs="0">
                        <simpleType>
                           <restriction base="string">
                              <maxLength value="10"/>
                           </restriction>
                        </simpleType>
                     </element>
                     <element name="Reason" minOccurs="0">
                        <simpleType>
                           <restriction base="string">
                              <maxLength value="254"/>
                           </restriction>
                        </simpleType>
                     </element>
                  </sequence>
               </complexType>
            </element>
         </sequence>
      </extension>
   </complexContent>
</complexType>