furkot / export-gpx

Generate GPX files from Furkot trip data.
https://trips.furkot.com
0 stars 0 forks source link

<tmd:TripName> is mandatory #9

Closed melitele closed 9 years ago

melitele commented 9 years ago

According the the schema (below) <tmd:TripName> is a mandatory subelement and should be emitted when <tmd:TripMetaData> element is emitted, even when trip name is not set. Otherwise exported GPX file is not valid.

    <?xml version="1.0"?>
<xsd:schema targetNamespace="http://www.garmin.com/xmlschemas/TripMetaDataExtensions/v1"
  elementFormDefault="qualified" xmlns="http://www.garmin.com/xmlschemas/TripMetaDataExtensions/v1"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:annotation>
    <xsd:documentation> This schema defines the Garmin route extensions specific to trips to be used
      with the GPX 1.1 schema. The GPX 1.1 schema is available at
      http://www.topografix.com/GPX/1/1/gpx.xsd. </xsd:documentation>
  </xsd:annotation>

  <xsd:element name="TripMetaData" type="TripMetaDataExtension_t"/>

  <xsd:complexType name="TripMetaDataExtension_t">
    <xsd:annotation>
      <xsd:documentation> This type contains data fields intended to be used as child elements of
        the rte element in the GPX 1.1 schema </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="TripName" type="xsd:string">
        <xsd:annotation>
          <xsd:documentation>This name indicates the name of the trip that this route is part of.</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="Date" type="xsd:dateTime" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>Either this element or the DayNumber element should be set.</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="DayNumber" type="xsd:unsignedInt" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>Either this element or the Date element should be set.</xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="Extensions" type="Extensions_t" minOccurs="0"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="Extensions_t">
    <xsd:annotation>
      <xsd:documentation>This type provides the ability to extend any data type that includes
        it.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
  </xsd:complexType>

</xsd:schema>
allthingssatnav commented 9 years ago

Under what condition(s) would tmd:TripMetaData not be used in the Garmin GPX Export?

melitele commented 9 years ago

<tmd:TripMetaData> is always emitted in Garmin GPX Export. The issue is with trips that have no name because the current implementation doesn't emit mandatory <tmd:TripName> in that case. The fix is going to make sure that <tmd:TripName> element is emitted even when trip has no name.

melitele commented 9 years ago

Fixed.