<?xml version="1.0" encoding="UTF-8"?>
<!-- Version 1.0 of the TripAdvisor Geo List XML Schema.
       -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xsd:element name="GeoList">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Geo" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="Geo">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded" />
        <xsd:element ref="TripAdvisorURL" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="HotelsURL" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="RestaurantsURL" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="AttractionsURL" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="FlightsURL" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="ViewPhotosURL" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="SeeAllPhotosURL" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="Type" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element ref="Description" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element ref="Latitude" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="Longitude" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="Awards" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="ChildGeos" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="TopProperties" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="Ancestors" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="NearestAirports" minOccurs="0" maxOccurs="1"/>
        <xsd:element ref="GeoHierarchy" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
      <xsd:attribute name="id" type="xsd:integer" use="required"/>
      <xsd:attribute name="typeid" type="xsd:integer" use="required"/>
    </xsd:complexType>
  </xsd:element>

  <xsd:element name="Name">
    <xsd:annotation>
      <xsd:documentation>
        Localized geo name
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attribute name="lang" type="xsd:string" use="required"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element> <!-- END Name Element -->

  <xsd:element name="TripAdvisorURL">
    <xsd:annotation>
      <xsd:documentation>
        URL on the TA site
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
  </xsd:element> <!-- END TripAdvisorURL Element -->

  <xsd:element name="HotelsURL">
    <xsd:annotation>
      <xsd:documentation>
        URL to view hotels for the geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
  </xsd:element> <!-- END HotelsURL Element -->

  <xsd:element name="RestaurantsURL">
    <xsd:annotation>
      <xsd:documentation>
        URL to view restaurants for the geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
  </xsd:element> <!-- END RestaurantsURL Element -->

  <xsd:element name="AttractionsURL">
    <xsd:annotation>
      <xsd:documentation>
        URL to view attractions for the geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
  </xsd:element> <!-- END AttractionsURL Element -->

  <xsd:element name="FlightsURL">
    <xsd:annotation>
      <xsd:documentation>
        URL to view flights for the geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
  </xsd:element> <!-- END FlightsURL Element -->

  <xsd:element name="ViewPhotosURL">
    <xsd:annotation>
      <xsd:documentation>
        URL for the view photos link
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
  </xsd:element> <!-- END ViewPhotosURL Element -->

  <xsd:element name="SeeAllPhotosURL">
    <xsd:annotation>
      <xsd:documentation>
        URL for the photo albums of geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
  </xsd:element> <!-- END SeeAllPhotosURL Element -->

  <xsd:element name="Type">
    <xsd:annotation>
      <xsd:documentation>
        Type information: TypeName is e.g. Country, State, Island
                          lang - is the language of the TypeName
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="TypeName" type="xsd:string"/>
      </xsd:sequence>
      <xsd:attribute name="lang" type="xsd:string" use="required"/>
    </xsd:complexType>
  </xsd:element> <!-- END Type Element -->

  <xsd:element name="Description">
    <xsd:annotation>
      <xsd:documentation>
        Localized geo description
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:simpleContent>
        <xsd:extension base="xsd:string">
          <xsd:attribute name="lang" type="xsd:string" use="required"/>
        </xsd:extension>
      </xsd:simpleContent>
    </xsd:complexType>
  </xsd:element> <!-- END Description Element -->

  <xsd:element name="Latitude">
    <xsd:annotation>
      <xsd:documentation>
        Latitude for this geo, if we have it and can distribute it
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:double"/>
    </xsd:simpleType>
  </xsd:element> <!-- END Latitude Element -->

  <xsd:element name="Longitude">
    <xsd:annotation>
      <xsd:documentation>
        Longitude for this geo, if we have it and can distribute it
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:double"/>
    </xsd:simpleType>
  </xsd:element> <!-- END Longitude Element -->

  <xsd:element name="Awards">
    <xsd:annotation>
      <xsd:documentation>
        Awards for this geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Award" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element> <!-- END Awards Element -->

  <xsd:element name="Award">
    <xsd:annotation>
      <xsd:documentation>
        Award element
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Name" type="xsd:string"/>
        <xsd:element ref="Categories" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="TinyImageURL" type="xsd:string"/>
        <xsd:element name="SmallImageURL" type="xsd:string"/>
        <xsd:element name="LargeImageURL" type="xsd:string"/>
      </xsd:sequence>
      <xsd:attribute name="type" type="xsd:string" />
      <xsd:attribute name="year" type="xsd:integer" />
    </xsd:complexType>
  </xsd:element> <!-- END Award Element -->

  <xsd:element name="Categories">
    <xsd:annotation>
      <xsd:documentation>
        Categories for this geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Category" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element> <!-- END Categories Element -->

  <xsd:element name="ChildGeos">
    <xsd:annotation>
      <xsd:documentation>
        Children geos, only appears if Geo is a country, island, state, region
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="ChildGeo" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element> <!-- END ChildGeos Element -->

  <xsd:element name="ChildGeo">
    <xsd:annotation>
      <xsd:documentation>
        Child geo element, id is of the child geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:attribute name="id" type="xsd:integer" />
      <xsd:attribute name="rank" type="xsd:integer" />
    </xsd:complexType>
  </xsd:element> <!-- END ChildGeo Element -->

  <xsd:element name="TopProperties">
    <xsd:annotation>
      <xsd:documentation>
        Top hotels, restaurants, attractions in this geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="TopProperty" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element> <!-- END TopProperties Element -->

  <xsd:element name="TopProperty">
    <xsd:annotation>
      <xsd:documentation>
        id - is the property, type - is hotel, restaurant, or attraction
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:attribute name="id" type="xsd:integer" />
      <xsd:attribute name="rank" type="xsd:integer" />
      <xsd:attribute name="type" type="xsd:string" />
    </xsd:complexType>
  </xsd:element> <!-- END TopProperty Element -->

  <xsd:element name="Ancestors">
    <xsd:annotation>
      <xsd:documentation>
        Ancestors of the geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Ancestor" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element> <!-- END Ancestors Element -->

  <xsd:element name="Ancestor">
    <xsd:annotation>
      <xsd:documentation>
        id - is the location id of the ancestor, level - is district, province, country, etc.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:attribute name="id" type="xsd:int" />
      <xsd:attribute name="level" type="xsd:string" />
    </xsd:complexType>
  </xsd:element> <!-- END Ancestor Element -->

  <xsd:element name="NearestAirports">
    <xsd:annotation>
      <xsd:documentation>
        The nearest airport to the center of the Geo. Not applicable to Country-level Geos
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="Airport" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element> <!-- END NearestAirports Element -->

  <xsd:element name="Airport">
    <xsd:annotation>
      <xsd:documentation>
        IATA airport code, name, and distance between the center of the Geo and the airport.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Code" type="xsd:string"/>
        <xsd:element ref="Name" minOccurs="0" maxOccurs="unbounded"/>
        <xsd:element name="Distance" type="xsd:string"/>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element> <!-- END Airport Element -->

  <xsd:element name="GeoHierarchy">
    <xsd:annotation>
      <xsd:documentation>
        Navigation string for this geo
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
  </xsd:element> <!-- END GeoHierarchy Element -->

</xsd:schema>