How to Read XSD-Driven XML

Kailin Opaleychuk
Kailin Opaleychuk
  • Updated

Introduction

This Tutorial demonstrates how to read a FIXM document using FME’s XSD-Driven XML Reader. FIXM stands for Flight Information Exchange Model. FIXM is a global standard model for integrating flight information and typically uses FIXM XML schemas. Here, we use FME Workbench to translate our FIXM document into an Esri File Geodatabase.

Reading Feature Paths Vs. Reading XSD Types as Features

Both feature paths and XSD types as features can be used to map features in FME Form. The approach you adopt may even be a combination! – similar to the example shown later in this tutorial, where we read a sample FIXM dataset. It should also be noted that when both are used, feature paths take precedence over XSD types. 

When we specify an XSD type as a feature, it means that all elements declared as that type will be mapped to feature types in FME. Therefore, any element declarations in the XSD that match or extend the selected type definition(s) will be identified by this parameter as a feature.

However, specifying a feature path is specifying a path from the root to the element, or simply the element itself. Elements selected here will be converted into FME feature types.

Ultimately, reading XSD types as features should be used when a hierarchical schema is present. When a hierarchical-type schema is present, it simplifies the process by potentially reducing the number of entries required for reading. This is because all elements declared by a type are identified at once rather than the individual elements themselves. However, for this to work optimally, an in-depth understanding of your schema is required.

Validation

XSD-Driven XML Validation determines whether the reader/writer should validate the XML document against the XSD schema. For more on Validation, please see the Validation section here.

Step-by-step Instructions

To follow along with this exercise from home, please download the contents in the Files section of this article. In this scenario, we convert an XSD-Driven XML document into an Esri File Geodatabase.

1. Create a New Workspace

Open FME Workbench on your machine, and start a new workspace.

2. Add an XSD-Driven XML Reader

Add a reader to the canvas and set the following: 

  • Format: XSD-Driven XML 
  • Dataset: <path>\fixm v1 ex1.xml
    • Click on the ellipses to navigate to the location on your computer

Click Parameters

XMLReader.png

In the parameters, click on the ellipsis next to Application Schema and navigate to the …\fixm11-master\msg\src\msg.xsd dataset. 

Then click on the ellipsis next to Feature Paths, and expand msg:FlightMessage. Select both of the following paths:

  • msg:FlightMessage/msg:flight 
  • msg:FlightMessage/msg:flight/fx:activeFlightPlan

SelectPaths.png

Once the Feature Paths have been set, click on the ellipsis next to XSD and select:

  • base:AbstractLocationType

Finally, set Validate Dataset to Yes, then click OK twice to finish adding the reader. 

XSDParams.png

3. Select Feature Types

In the Select Feature Type dialog, select the following as Feature Types: 

  • activeFlightPlan
  • flight
  • location. 

Click OK to add them to the canvas.

SelectFT.png

4. Inspect the Data

With Run with Data Caching (formerly Feature Caching) enabled, click Run to cache the data. Use the Data Preview (formerly Visual Preview) window to inspect the FIXM flight and activeFlightPlan reader feature types. Notice that the flight table is the parent for activeFlightPlan. 

InspectFT.png

5. Add a FeatureMerger

Merge the parent (flight) and child (activeFlightPlan) Feature Types using a FeatureMerger transformer. Connect the flight to the Supplier port, and activeFlightPlan to the Requestor port. 

In the parameters, set the following:

  • Join On:
    • Requestor: xml_parent_id
      • Supplier: xml_id
      • Comparison Mode: Automatic
  • Merge Parameters:
    • Feature Merge Type: Attributes Only
  • Attribute Accumulation:
    • Accumulation Mode: Prefix Supplier
    • Prefix: Flight_

FM1.png

6. Merge Location

Now, we are going to merge another XML child (location) feature type onto our previously merged XML data. Duplicate the FeatureMerger by selecting it and pressing (ctrl+d or cmd+d) on your keyboard. In this merge, the child (location) will be the Requestor. The Supplier will be the results from the previous FeatureMerger, specifically the output of the Merged port. Note that the Requestor input port was moved down to clean up the lines. This is done by right-clicking on the port and selecting Move Down. 

FMConnections.png

In the FeatureMerger_2 parameters, since we duplicated the previous FeatureMerger, we only need to change the Prefix. Change:

  • Prefix: ActiveFlightPlan_  

FM2.png

7. Create Point Data

Add a VertexCreator to your workspace and connect it to the Merged output port from the FeatureMerger_2. In the parameters, set the following:

  • Mode: Add Point
  • X Value: base_long
  • Y Value: base_lat

VertexCreator.png

8. Assign a Coordinate System

Use a CoordinateSystemSetter to assign a coordinate system to your features. Open the parameters and select LL84.

CoordinateSystem.png

9. Add an AttributeKeeper

Before writing to the File Geodatabase, we should remove unnecessary or empty attributes. To do this, add an AttributeKeeper to the canvas and connect it to the CoordinateSystemSetter. 

In the parameters, use the Filter bar to find the attribute to keep:

  • ActiveFlightPlan_Flight_gufi
  • ActiveFlightPlan_fx_flightPlanIdentifier
  • ActiveFlightPlan_xml_id
  • ActiveFlightPlan_xml_parent_id
  • ActiveFlightPlan_xml_parent_property
  • base_lat
  • base_long
  • base_srsName
  • xml_id
  • xml_parent_id
  • xml_parent_property

You can also copy and paste the following comma-delimited list to save time:

ActiveFlightPlan_Flight_gufi,ActiveFlightPlan_fx_flightPlanIdentifier,ActiveFlightPlan_xml_id,ActiveFlightPlan_xml_parent_id,ActiveFlightPlan_xml_parent_property,base_lat,base_long,base_srsName,xml_parent_id,xml_parent_property

10. Add another AttributeKeeper.

Add a second AttributeKeeper to the canvas and connect it to the CoordinateSystemSetter. In the parameters, select the following attributes to keep. Note: when using the Filter search, use the words before the periods, then expand the options: 

  • ActiveFlightPlan_departure.estimatedDepartureTime
  • ActiveFlightPlan_enRoute.alternateAerodromeRoute.text
  • ActiveFlightPlan_filing.accepted
  • ActiveFlightPlan_flightType
  • ActiveFlightPlan_request.airspeed
  • ActiveFlightPlan_request.airspeed.base_uom
  • ActiveFlightPlan_request.flightRules
  • xml_id
  • xml_parent_id
  • xml_parent_property

Again, to save time, you can copy and paste the following list:

ActiveFlightPlan_departure.estimatedDepartureTime,ActiveFlightPlan_enRoute.alternateAerodromeRoute.text,ActiveFlightPlan_filing.accepted,ActiveFlightPlan_flightType,ActiveFlightPlan_request.airspeed,ActiveFlightPlan_request.airspeed.base_uom,xml_id,xml_parent_id,xml_parent_property

FinalWorkspace.png

11. Add a File Geodatabase Writer.

Add a writer to the canvas and set the following parameters:

  • Format: Esri Geodatabase (File Geodb Open API) 
  • Dataset: <path>\FIXM_EX.gdb
    • Click on the ellipses to navigate to a location on your computer
  • Feature Class or Table Definition: Copy from Reader

Click OK. 

GeoDbWriter.png

In the Select Feature Type dialog, select the flight and location feature types and then click OK. 

SelectWriterFT.png

Connect the location writer feature type to the AttributeKeeper and the flight writer feature type to the AttributeKeeper_2. 

WriterConnections.png

12. Change Feature Type Geometry

Open the location writer feature type parameters and change the Geometry to geodb_point. 

geom.png

Then open the flight writer feature type parameters, change the Geometry to geodb_point, then switch to the User Attributes tab. Change the Attribute Definition to Automatic to use only the attributes selected in the AttributeKeeper. 

Automatic.png

13. Run the Workspace.

Run the workspace and inspect the output using either Visual Preview or Esri ArcGIS. 

FinalWorksapce.png

Your results should look similar to the document below. You will notice our flight path crosses the International Date Line and is visually segmented into two parts, though the results are accurate. 

15.jpg

Data Attribution

The data in this article originated from a GitHub repository made available by FIXM, managed by the US Department of Transportation.

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.