ChatGPT's analysis of the Garmin Flight Plan (.fpl) XML Schema

I’m not entirely confident this will actually be useful to anybody, nor am I confident that it is accurate/correct, considering its source, but I asked the regular ole 3.5 GPT to analyze the contents of the Garmin proprietary file format upon which our .fpl files are based. I know I found it quite interesting.

Prompt: I’m going to provide the whole of the original schema for Garmin’s Flight Plan (XML) files. I would like you to analyze and annotate/explain it in as much detail as possible:


Reponse

Certainly! Let’s break down the provided XML schema for Garmin’s Flight Plan in detail. Each component will be explained in context:

Overview

This XML schema defines the structure of Garmin Flight Plan files. It uses XML Schema Definition (XSD) language to specify elements, complex types, simple types, constraints, and documentation.

XML Declaration

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

This line declares the XML version and the character encoding used. It also indicates that the document is standalone (i.e., it does not depend on any external DTD or schema).

Schema Element

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www8.garmin.com/xmlschemas/FlightPlan/v1" xmlns:fp="http://www8.garmin.com/xmlschemas/FlightPlan/v1" targetNamespace="http://www8.garmin.com/xmlschemas/FlightPlan/v1" elementFormDefault="qualified">
  • xmlns:xsd="http://www.w3.org/2001/XMLSchema": Declares the XSD namespace for schema definitions.
  • xmlns="http://www8.garmin.com/xmlschemas/FlightPlan/v1": Declares the default namespace used in this schema.
  • xmlns:fp="http://www8.garmin.com/xmlschemas/FlightPlan/v1": Declares a prefix for the default namespace, which is useful for XPath expressions.
  • targetNamespace: Specifies the namespace for the elements defined in this schema.
  • elementFormDefault="qualified": Ensures that all elements must be namespace-qualified.

Annotations and Documentation

Annotations provide human-readable documentation for schema components.

<xsd:annotation>
    <xsd:documentation>
      To transform a FlightPlan v1 XML document to GPX format a stylesheet will exist
      on the Garmin website.
    </xsd:documentation>
</xsd:annotation>

This annotation documents the purpose of the schema, mentioning a stylesheet for transforming FlightPlan XML to GPX format.

Root Element: flight-plan

<xsd:element name="flight-plan" type="FlightPlan_t">

Defines the root element <flight-plan> of type FlightPlan_t.

Key Constraints

<xsd:key name="WaypointIdKey">
    <xsd:annotation>
        <xsd:documentation>
            This key requires that the identifier, type, and country-codes values 
            be unique in the waypoint table.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:selector xpath="fp:waypoint-table/fp:waypoint" />
    <xsd:field xpath="fp:identifier" />
    <xsd:field xpath="fp:type" />
    <xsd:field xpath="fp:country-code" />
</xsd:key>

This key ensures that within the waypoint table, the combination of identifier, type, and country-code must be unique.

<xsd:keyref name="WaypointIdKeyRef" refer="WaypointIdKey">
    <xsd:annotation>
        <xsd:documentation>
            This key requires the route-point values be in the waypoint table.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:selector xpath="fp:route/fp:route-point" />
    <xsd:field xpath="fp:waypoint-identifier" />
    <xsd:field xpath="fp:waypoint-type" />
    <xsd:field xpath="fp:waypoint-country-code" />
</xsd:keyref>

This key reference ensures that route points must reference existing waypoints in the waypoint table.

Complex Types

FlightPlan_t

<xsd:complexType name="FlightPlan_t">
    <xsd:sequence>
        <xsd:element name="file-description" type="xsd:string" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>
                    This element is for reference only and is ignored by the device.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="author" type="Person_t" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>
                    The person or organization who created this flight plan.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="link" type="xsd:anyURI" minOccurs="0" />
        <xsd:element name="created" type="UtcTime_t" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>
                    The creation date and time of this flight plan.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="waypoint-table" type="WaypointTable_t" />
        <xsd:element name="route" type="Route_t" minOccurs="0" />
        <xsd:element name="extensions" type="Extensions_t" minOccurs="0" />
    </xsd:sequence>
</xsd:complexType>
  • file-description: Optional string element ignored by devices.
  • author: Optional Person_t element detailing the creator.
  • link: Optional URI element.
  • created: Optional UTC time element.
  • waypoint-table: Required WaypointTable_t element containing waypoints.
  • route: Optional Route_t element defining the route.
  • extensions: Optional Extensions_t element for future extensions.

WaypointTable_t

<xsd:complexType name="WaypointTable_t">
    <xsd:annotation>
        <xsd:documentation>
            An unordered list of unique waypoints referenced by a flight plan.
            This table may also contain waypoints not referenced by the route
            of a flight plan.
        </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
        <xsd:element name="waypoint" type="Waypoint_t" maxOccurs="3000">
            <xsd:annotation>
                <xsd:documentation>
                    Different Garmin devices have different limits on the number of
                    user waypoints allowed. If the number of waypoints in the XML
                    file exceeds the limits of the device then only the allowable number
                    will be transferred to the device's user waypoint list.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
    </xsd:sequence>
</xsd:complexType>

This complex type defines a list of up to 3000 waypoints. Each waypoint is of type Waypoint_t.

Waypoint_t

<xsd:complexType name="Waypoint_t">
    <xsd:sequence>
        <xsd:element name="identifier" type="Identifier_t" />
        <xsd:element name="type" type="WaypointType_t" />
        <xsd:element name="country-code" type="CountryCode_t">
            <xsd:annotation>
                <xsd:documentation>
                    The country code should be the empty string for user waypoints.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="lat" type="Latitude_t" />
        <xsd:element name="lon" type="Longitude_t" />
        <xsd:element name="comment" type="Comment_t">
            <xsd:annotation>
                <xsd:documentation>
                    User waypoint comments. This will be transferable to the 
                    device with this field. Not all Garmin devices allow the 
                    same number of characters, if the limit of the device is 
                    less than the length of the comment then the value will be truncated.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="elevation" type="xsd:decimal" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>
                    Elevation (in meters) of the waypoint. This value is ignored by
                    panel mount devices.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="waypoint-description" type="xsd:string" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>
                    This field is for reference only and is ignored by the device.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="symbol" type="xsd:string" minOccurs="0">
            <xsd:annotation>
                <xsd:documentation>
                    This field contains the text name of the waypoint symbol.  
                    For interchange with other programs, use the exact spelling
                    of the symbol as displayed on the device. If the device
                    abbreviates words, spell them out. This element will be 
                    ignored by Garmin devices which do not accept the symbol
                    element.
                </xsd:documentation>
            </xsd:annotation>
        </xsd:element>
        <xsd:element name="extensions" type="Extensions_t" min

1 Like

Good day,
thanks for the info of the Garmin Flight plan .fpl. im trying to upload the file into GNS430 and keep getting the error “not a valid garmin flight plan file”. Reading all of this is a bit much for me, any chance to break it down for me.
thanks

1 Like

Can I ask what the source of the file is? If you’re sharing an .fpl straight out of Infinite Flight, I’m not sure there’s going to be an easy solution. Going the other way though, I would definitely recommend SkyVector.

I managed to fix the issue. I used route plan converter, uploaded a .gpx file with all waypoints and then saved it as a Garmin flight plan file (.fpl). That did it.

1 Like

I recently designed a GPT that I could dump any flight plan file into and it would output a properly formatted .fpl for IF. It was handy for a minute, then I just started using .kml files and converting them with IF flight plan tools.

1 Like

Quick tip here: Garmin publishes all of their XML schemas on the public internet.

Just take the xml namespace, delete the slash before the version and append “.xsd” to the end:

https://www8.garmin.com/xmlschemas/FlightPlanv1.xsd