- 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
Feature-type Element
Every feature mapping rule may (this is an optional element) contain one feature-type element, the contents of this element is an expression sequence whose value becomes the feature type of the constructed FME feature. This is represented in xfMap by the <feature-type> element:
<feature-type> <!-- the content is some expression sequence --> </feature-type>
Note: The feature type for the FME feature that is under construction is set only by the first activated feature mapping rule that contains a <feature-type> element. Subsequent feature mapping rules with <feature-type> elements for the same FME feature under construction are ignored by the XML Reader.
The following xfMap document, feature_type.xmp, contains a mapping rule Rp that matches a <point> element from the input points1.xml document. Here Rp has a <feature-type> element that instructs the XML Reader to set the feature type for the FME feature that is under construction.
feature_type.xmp
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xfMap SYSTEM "xfMap.dtd"> <xfMap> <feature-map> <!-- Call this mapping rule Rp --> <mapping match="point"> <feature-type> <!-- the feature-type element has as its contents an xfMap expression sequence. An expression sequence is a sequence of expression elements. --> <extract expr="@name"/> <literal expr="_"/> <extract expr="@num"/> </feature-type> </mapping> </feature-map> </xfMap>
When the points1.xml and the above feature_type.xmp documents are fed into the XML Reader, the following FME features are constructed:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: myPoint_0'
Attribute: xml_type' has value xml_no_geom'
Geometry Type: Unknown (0)
==============================================================
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: myPoint_1'
Attribute: xml_type' has value xml_no_geom'
Geometry Type: Unknown (0)
==============================================================