- XML (Extensible Markup Language) Reader/Writer
- XML Quick Facts
- Workbench XML Reader Parameters
- Workbench XML Writer Parameters
- Feature Representation
- Mapping File Reference
- xfMap
- Reading the Input XML Document
- Mapping Rules
- Types of Mapping Rules
- Match and Except Expression
- Specifying Several Match Expressions for One Mapping Rule
- Limiting Mapping Rule Activation with Except Expressions
- Mapping Rule States (activation, execution, suspension, and de-activation)
- Using Force Elements During Mapping Rule Activation and Deactivation
- Search-sets
- Expression Elements (Extract and Literal)
- Expression Sequence
- Feature Mapping Rules
- FME Feature Construction
- Feature Type Element
- Attributes Element
- FME Feature Construction (defining mapping rules under the <feature-content-map> element)
- Attribute Element (handling multiple values)
- Attribute Element (handling optional attributes)
- Attribute Element (sequenced attributes)
- Attribute Element (Nillable Attributes)
- Geometry Element
- Geometry Builder States (activation, execution, suspension, and de-activation)
- Geometry Construction
- Composite Geometry Builders
- Built-in Geometry Builders
- xml-point
- xml-point-xy
- xml-line
- xml-area
- xml-donut
- xml-aggregate
- xml-box
- xml-text
- xml-path
- xml-arc
- xml-arc-by-center-point
- xml-elliptical-arc
- xml-circle
- xml-clothoid
- xml-polygon
- xml-face
- xml-composite-surface
- xml-triangulated-surface
- xml-enclosed-surface
- xml-composite-solid
- xml-multi-point
- xml-multi-curve
- xml-multi-area
- xml-multi-text
- xml-multi-surface
- xml-multi-solid
- xml-null
- xml-reverse-geometry
- xml-geodesic-string
- fme-geometry
- Mapping Segmented Geometric Information
- Geometry Traits (trait element)
- FME Feature Construction (constructing multiple features at a time)
- Structure Element
- References Element
- Apply References Element
- Group Mapping Rules
- Reference Mapping Rules
- Mapping Rules (Optional Elements)
- More Expression Elements
- FME Schema Features
- Reading the Input XML Document
DEF Lines
The DEF lines control the generation of the XML document.
The syntax of the XML DEF line is:
<WriterKeyword>_DEF <table name> \ [<attribute name> <attribute type>]*
The valid values for <attribute type> are: xml_char(width), xml_int32, xml_real32, xml_decimal(width, decimal), xml_boolean, xml_real64, and xml_xml.
A DEF line specifies the form an element takes in the output XML document that represents a table row. The element type is defined in the generated XML Schema document as a Complex Type definition.
For example, the following DEF line:
XML_DEF row \ area xml_real64 \ code xml_char(5) \ num xml_decimal(3,0) fragment xml_xml
generates in the XML Schema document the following XML Schema Complex Type:
<complexType name=”rowType”> <sequence> <element name=”area” type=”double”/> <element name=”code”> <restriction base=”string”> <maxLength value=”5”/> </restriction> </element> <element name=”num”> <restriction base=”decimal”> <totalDigits value=”3”/> <fractionDigits value=”0”/> </restriction> </element> <any min0ccurs="0" processcontents="lax" /> </sequence> </complexType>
An FME feature corresponding to the DEF line, that is, a feature with feature type row, will be written in the output DATASET document as:
<fme:row> <fme:area>28002.325</fme:area> <fme:code>MX02</fme:code> <fme:num>345</fme:num> <gml:pointProperty> _ <gml:PointProperty> </fme:row>
Note: The example assumes that the TARGET_NS_PREFIX has been set to fme
which is the default value.
The “fragment” attribute with “xml_xml” type assumes an XML document as its value. Note that in the example gml prefix must’ve also been bound to a namespace URI in a namespace declaration in the root element, the XML_NAMESPACE_DECLARATIONS directive may be used to add namespace declarations on the root element.
If an XML_DEF line contains multiple attributes that are set to xml_xml type then its corresponding complex type definition will be defined with the “xs:any” wildcard, for example, given the DEF line:
XML_DEF row \ a xml_xml \ b xml_char (5) \ c xml_xml
The corresponding complex type definition in the .xsd document becomes:
<complexType name=”rowType”> <sequence> <any minOccurs=”0” processContent=”lax” maxOccurs=”unbounded”/> </sequence> </complexType>