<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified">

<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>

  <xs:element name="listings">
    <xs:annotation>
      <xs:documentation>
        Encapsulates all the listings in the feed. This is the document root
        tag of the XML file.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="language"/>
        <xs:element minOccurs="0" ref="datum"/>
        <xs:element minOccurs="0" ref="shared_content"/>
        <xs:element minOccurs="1" maxOccurs="unbounded" ref="listing"/>
      </xs:sequence>
    </xs:complexType>

    <!-- Enforce unique listings -->
    <xs:unique name="uniqueId">
      <xs:selector xpath=".//listing"/>
      <xs:field xpath="id"/>
    </xs:unique>

    <!-- Enforce unique coupon ids across shared/specific coupons -->
    <xs:unique name="uniqueCouponId">
      <xs:selector xpath=".//shared_content/coupon | .//listing/content/coupon"/>
      <xs:field xpath="id"/>
    </xs:unique>

   <!-- Ensure idrefs used by coupons refer to declared ids -->
    <xs:keyref name="couponRef" refer="uniqueCouponId">
      <xs:selector xpath=".//shared_content/coupon | .//listing/content/coupon"/>
      <xs:field xpath="idref"/>
    </xs:keyref>

  </xs:element>

  <xs:element name="shared_content">
    <xs:annotation>
      <xs:documentation>
        Acts a container for data shared b/w in listings in the feed.
        As of 2009/04, this is just coupons.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="coupon"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="language">
    <xs:annotation>
      <xs:documentation>
        The language used in this feed. The value must be an ISO 639
        lowercase 2-letter language code (http://www.w3.org/WAI/ER/IG/ert/iso639.htm#2letter).
        For example English is en, French is fr.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:language">
        <xs:enumeration value="aa"/>
        <xs:enumeration value="ab"/>
        <xs:enumeration value="af"/>
        <xs:enumeration value="am"/>
        <xs:enumeration value="ar"/>
        <xs:enumeration value="as"/>
        <xs:enumeration value="ay"/>
        <xs:enumeration value="az"/>
        <xs:enumeration value="ba"/>
        <xs:enumeration value="be"/>
        <xs:enumeration value="bg"/>
        <xs:enumeration value="bh"/>
        <xs:enumeration value="bi"/>
        <xs:enumeration value="bn"/>
        <xs:enumeration value="bo"/>
        <xs:enumeration value="br"/>
        <xs:enumeration value="ca"/>
        <xs:enumeration value="co"/>
        <xs:enumeration value="cs"/>
        <xs:enumeration value="cy"/>
        <xs:enumeration value="da"/>
        <xs:enumeration value="de"/>
        <xs:enumeration value="dz"/>
        <xs:enumeration value="el"/>
        <xs:enumeration value="en"/>
        <xs:enumeration value="eo"/>
        <xs:enumeration value="es"/>
        <xs:enumeration value="et"/>
        <xs:enumeration value="eu"/>
        <xs:enumeration value="fa"/>
        <xs:enumeration value="fi"/>
        <xs:enumeration value="fj"/>
        <xs:enumeration value="fo"/>
        <xs:enumeration value="fr"/>
        <xs:enumeration value="fy"/>
        <xs:enumeration value="ga"/>
        <xs:enumeration value="gd"/>
        <xs:enumeration value="gl"/>
        <xs:enumeration value="gn"/>
        <xs:enumeration value="gu"/>
        <xs:enumeration value="ha"/>
        <xs:enumeration value="he"/>
        <xs:enumeration value="hi"/>
        <xs:enumeration value="hr"/>
        <xs:enumeration value="hu"/>
        <xs:enumeration value="hy"/>
        <xs:enumeration value="ia"/>
        <xs:enumeration value="ie"/>
        <xs:enumeration value="ik"/>
        <xs:enumeration value="in"/>
        <xs:enumeration value="is"/>
        <xs:enumeration value="it"/>
        <xs:enumeration value="iw"/>
        <xs:enumeration value="ja"/>
        <xs:enumeration value="ji"/>
        <xs:enumeration value="jw"/>
        <xs:enumeration value="ka"/>
        <xs:enumeration value="kk"/>
        <xs:enumeration value="kl"/>
        <xs:enumeration value="km"/>
        <xs:enumeration value="kn"/>
        <xs:enumeration value="ko"/>
        <xs:enumeration value="ks"/>
        <xs:enumeration value="ku"/>
        <xs:enumeration value="ky"/>
        <xs:enumeration value="la"/>
        <xs:enumeration value="ln"/>
        <xs:enumeration value="lo"/>
        <xs:enumeration value="lt"/>
        <xs:enumeration value="lv"/>
        <xs:enumeration value="mg"/>
        <xs:enumeration value="mi"/>
        <xs:enumeration value="mk"/>
        <xs:enumeration value="ml"/>
        <xs:enumeration value="mn"/>
        <xs:enumeration value="mo"/>
        <xs:enumeration value="mr"/>
        <xs:enumeration value="ms"/>
        <xs:enumeration value="mt"/>
        <xs:enumeration value="my"/>
        <xs:enumeration value="na"/>
        <xs:enumeration value="ne"/>
        <xs:enumeration value="nl"/>
        <xs:enumeration value="no"/>
        <xs:enumeration value="oc"/>
        <xs:enumeration value="om"/>
        <xs:enumeration value="or"/>
        <xs:enumeration value="pa"/>
        <xs:enumeration value="pl"/>
        <xs:enumeration value="ps"/>
        <xs:enumeration value="pt"/>
        <xs:enumeration value="qu"/>
        <xs:enumeration value="rm"/>
        <xs:enumeration value="rn"/>
        <xs:enumeration value="ro"/>
        <xs:enumeration value="ru"/>
        <xs:enumeration value="rw"/>
        <xs:enumeration value="sa"/>
        <xs:enumeration value="sd"/>
        <xs:enumeration value="sg"/>
        <xs:enumeration value="sh"/>
        <xs:enumeration value="si"/>
        <xs:enumeration value="sk"/>
        <xs:enumeration value="sl"/>
        <xs:enumeration value="sm"/>
        <xs:enumeration value="sn"/>
        <xs:enumeration value="so"/>
        <xs:enumeration value="sq"/>
        <xs:enumeration value="sr"/>
        <xs:enumeration value="ss"/>
        <xs:enumeration value="st"/>
        <xs:enumeration value="su"/>
        <xs:enumeration value="sv"/>
        <xs:enumeration value="sw"/>
        <xs:enumeration value="ta"/>
        <xs:enumeration value="te"/>
        <xs:enumeration value="tg"/>
        <xs:enumeration value="th"/>
        <xs:enumeration value="ti"/>
        <xs:enumeration value="tk"/>
        <xs:enumeration value="tl"/>
        <xs:enumeration value="tn"/>
        <xs:enumeration value="to"/>
        <xs:enumeration value="tr"/>
        <xs:enumeration value="ts"/>
        <xs:enumeration value="tt"/>
        <xs:enumeration value="tw"/>
        <xs:enumeration value="uk"/>
        <xs:enumeration value="ur"/>
        <xs:enumeration value="uz"/>
        <xs:enumeration value="vi"/>
        <xs:enumeration value="vo"/>
        <xs:enumeration value="wo"/>
        <xs:enumeration value="xh"/>
        <xs:enumeration value="yo"/>
        <xs:enumeration value="zh"/>
        <xs:enumeration value="zu"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="datum">
    <xs:annotation>
      <xs:documentation>
        The datum in use for geographic coordinates.
        Currently supported values:  TOKYO, WGS84
        If this tag is absent, WGS84 is assumed.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="TOKYO"/>
        <xs:enumeration value="tokyo"/>
        <xs:enumeration value="WGS84"/>
        <xs:enumeration value="wgs84"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="listing">
    <xs:annotation>
      <xs:documentation>
        Encapsulates all the information related to a single business.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="id"/>
        <xs:element ref="name"/>
        <xs:element ref="address"/>
        <xs:element ref="country"/>
        <xs:element minOccurs="0" ref="latitude"/>
        <xs:element minOccurs="0" ref="longitude"/>
        <xs:element minOccurs="0" ref="locationinfo"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="phone"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="category"/>
        <xs:element minOccurs="0" ref="date"/>
        <xs:element minOccurs="0" ref="content"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="id">
    <xs:annotation>
      <xs:documentation>
        Unique ID of the listing on your site.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="name">
    <xs:annotation>
      <xs:documentation>
        The name of the business.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="address">
    <xs:annotation>
      <xs:documentation>
        Address of the business, including street number, street name,
        town/city, state/province/region, and postal code. Example:
        1600 Amphitheatre Parkway, Mountain View, CA 94043
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="component"/>
      </xs:sequence>
      <xs:attributeGroup ref="attlist.address"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.address">
    <xs:annotation>
      <xs:documentation>
        The type of address data provided.
      </xs:documentation>
    </xs:annotation>
    <xs:attribute name="format">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:minLength value="1"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="component">
    <xs:annotation>
      <xs:documentation>
        A particular component of an address.  Example:
        <component name="addr1">1600 Amphitheatre Parkway</component>
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.component"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.component">
    <xs:annotation>
      <xs:documentation>
        The type of address component provided.  Example: addr1
      </xs:documentation>
    </xs:annotation>
    <xs:attribute name="name" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:minLength value="1"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="country">
    <xs:annotation>
      <xs:documentation>
        The country that this listing is located in. The value must be a
        ISO 3116 uppercase 2-letter country code (http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html).
        For example, United States is US and Canada is CA.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:enumeration value="AD"/>
        <xs:enumeration value="AE"/>
        <xs:enumeration value="AF"/>
        <xs:enumeration value="AG"/>
        <xs:enumeration value="AI"/>
        <xs:enumeration value="AL"/>
        <xs:enumeration value="AM"/>
        <xs:enumeration value="AN"/>
        <xs:enumeration value="AO"/>
        <xs:enumeration value="AQ"/>
        <xs:enumeration value="AR"/>
        <xs:enumeration value="AS"/>
        <xs:enumeration value="AT"/>
        <xs:enumeration value="AU"/>
        <xs:enumeration value="AW"/>
        <xs:enumeration value="AX"/>
        <xs:enumeration value="AZ"/>
        <xs:enumeration value="BA"/>
        <xs:enumeration value="BB"/>
        <xs:enumeration value="BD"/>
        <xs:enumeration value="BE"/>
        <xs:enumeration value="BF"/>
        <xs:enumeration value="BG"/>
        <xs:enumeration value="BH"/>
        <xs:enumeration value="BI"/>
        <xs:enumeration value="BJ"/>
        <xs:enumeration value="BM"/>
        <xs:enumeration value="BN"/>
        <xs:enumeration value="BO"/>
        <xs:enumeration value="BR"/>
        <xs:enumeration value="BS"/>
        <xs:enumeration value="BT"/>
        <xs:enumeration value="BV"/>
        <xs:enumeration value="BW"/>
        <xs:enumeration value="BY"/>
        <xs:enumeration value="BZ"/>
        <xs:enumeration value="CA"/>
        <xs:enumeration value="CC"/>
        <xs:enumeration value="CD"/>
        <xs:enumeration value="CF"/>
        <xs:enumeration value="CG"/>
        <xs:enumeration value="CH"/>
        <xs:enumeration value="CI"/>
        <xs:enumeration value="CK"/>
        <xs:enumeration value="CL"/>
        <xs:enumeration value="CM"/>
        <xs:enumeration value="CN"/>
        <xs:enumeration value="CO"/>
        <xs:enumeration value="CR"/>
        <xs:enumeration value="CS"/>
        <xs:enumeration value="CU"/>
        <xs:enumeration value="CV"/>
        <xs:enumeration value="CX"/>
        <xs:enumeration value="CY"/>
        <xs:enumeration value="CZ"/>
        <xs:enumeration value="DE"/>
        <xs:enumeration value="DJ"/>
        <xs:enumeration value="DK"/>
        <xs:enumeration value="DM"/>
        <xs:enumeration value="DO"/>
        <xs:enumeration value="DZ"/>
        <xs:enumeration value="EC"/>
        <xs:enumeration value="EE"/>
        <xs:enumeration value="EG"/>
        <xs:enumeration value="EH"/>
        <xs:enumeration value="ER"/>
        <xs:enumeration value="ES"/>
        <xs:enumeration value="ET"/>
        <xs:enumeration value="FI"/>
        <xs:enumeration value="FJ"/>
        <xs:enumeration value="FK"/>
        <xs:enumeration value="FM"/>
        <xs:enumeration value="FO"/>
        <xs:enumeration value="FR"/>
        <xs:enumeration value="GA"/>
        <xs:enumeration value="GB"/>
        <xs:enumeration value="GD"/>
        <xs:enumeration value="GE"/>
        <xs:enumeration value="GF"/>
        <xs:enumeration value="GG"/>
        <xs:enumeration value="GH"/>
        <xs:enumeration value="GI"/>
        <xs:enumeration value="GL"/>
        <xs:enumeration value="GM"/>
        <xs:enumeration value="GN"/>
        <xs:enumeration value="GP"/>
        <xs:enumeration value="GQ"/>
        <xs:enumeration value="GR"/>
        <xs:enumeration value="GS"/>
        <xs:enumeration value="GT"/>
        <xs:enumeration value="GU"/>
        <xs:enumeration value="GW"/>
        <xs:enumeration value="GY"/>
        <xs:enumeration value="HK"/>
        <xs:enumeration value="HM"/>
        <xs:enumeration value="HN"/>
        <xs:enumeration value="HR"/>
        <xs:enumeration value="HT"/>
        <xs:enumeration value="HU"/>
        <xs:enumeration value="ID"/>
        <xs:enumeration value="IE"/>
        <xs:enumeration value="IL"/>
        <xs:enumeration value="IM"/>
        <xs:enumeration value="IN"/>
        <xs:enumeration value="IO"/>
        <xs:enumeration value="IQ"/>
        <xs:enumeration value="IR"/>
        <xs:enumeration value="IS"/>
        <xs:enumeration value="IT"/>
        <xs:enumeration value="JE"/>
        <xs:enumeration value="JM"/>
        <xs:enumeration value="JO"/>
        <xs:enumeration value="JP"/>
        <xs:enumeration value="KE"/>
        <xs:enumeration value="KG"/>
        <xs:enumeration value="KH"/>
        <xs:enumeration value="KI"/>
        <xs:enumeration value="KM"/>
        <xs:enumeration value="KN"/>
        <xs:enumeration value="KP"/>
        <xs:enumeration value="KR"/>
        <xs:enumeration value="KW"/>
        <xs:enumeration value="KY"/>
        <xs:enumeration value="KZ"/>
        <xs:enumeration value="LA"/>
        <xs:enumeration value="LB"/>
        <xs:enumeration value="LC"/>
        <xs:enumeration value="LI"/>
        <xs:enumeration value="LK"/>
        <xs:enumeration value="LR"/>
        <xs:enumeration value="LS"/>
        <xs:enumeration value="LT"/>
        <xs:enumeration value="LU"/>
        <xs:enumeration value="LV"/>
        <xs:enumeration value="LY"/>
        <xs:enumeration value="MA"/>
        <xs:enumeration value="MC"/>
        <xs:enumeration value="MD"/>
        <xs:enumeration value="ME"/>
        <xs:enumeration value="MG"/>
        <xs:enumeration value="MH"/>
        <xs:enumeration value="MK"/>
        <xs:enumeration value="ML"/>
        <xs:enumeration value="MM"/>
        <xs:enumeration value="MN"/>
        <xs:enumeration value="MO"/>
        <xs:enumeration value="MP"/>
        <xs:enumeration value="MQ"/>
        <xs:enumeration value="MR"/>
        <xs:enumeration value="MS"/>
        <xs:enumeration value="MT"/>
        <xs:enumeration value="MU"/>
        <xs:enumeration value="MV"/>
        <xs:enumeration value="MW"/>
        <xs:enumeration value="MX"/>
        <xs:enumeration value="MY"/>
        <xs:enumeration value="MZ"/>
        <xs:enumeration value="NA"/>
        <xs:enumeration value="NC"/>
        <xs:enumeration value="NE"/>
        <xs:enumeration value="NF"/>
        <xs:enumeration value="NG"/>
        <xs:enumeration value="NI"/>
        <xs:enumeration value="NL"/>
        <xs:enumeration value="NO"/>
        <xs:enumeration value="NP"/>
        <xs:enumeration value="NR"/>
        <xs:enumeration value="NU"/>
        <xs:enumeration value="NZ"/>
        <xs:enumeration value="OM"/>
        <xs:enumeration value="PA"/>
        <xs:enumeration value="PE"/>
        <xs:enumeration value="PF"/>
        <xs:enumeration value="PG"/>
        <xs:enumeration value="PH"/>
        <xs:enumeration value="PK"/>
        <xs:enumeration value="PL"/>
        <xs:enumeration value="PM"/>
        <xs:enumeration value="PN"/>
        <xs:enumeration value="PR"/>
        <xs:enumeration value="PS"/>
        <xs:enumeration value="PT"/>
        <xs:enumeration value="PW"/>
        <xs:enumeration value="PY"/>
        <xs:enumeration value="QA"/>
        <xs:enumeration value="RE"/>
        <xs:enumeration value="RO"/>
        <xs:enumeration value="RS"/>
        <xs:enumeration value="RU"/>
        <xs:enumeration value="RW"/>
        <xs:enumeration value="SA"/>
        <xs:enumeration value="SB"/>
        <xs:enumeration value="SC"/>
        <xs:enumeration value="SD"/>
        <xs:enumeration value="SE"/>
        <xs:enumeration value="SG"/>
        <xs:enumeration value="SH"/>
        <xs:enumeration value="SI"/>
        <xs:enumeration value="SJ"/>
        <xs:enumeration value="SK"/>
        <xs:enumeration value="SL"/>
        <xs:enumeration value="SM"/>
        <xs:enumeration value="SN"/>
        <xs:enumeration value="SO"/>
        <xs:enumeration value="SR"/>
        <xs:enumeration value="ST"/>
        <xs:enumeration value="SV"/>
        <xs:enumeration value="SY"/>
        <xs:enumeration value="SZ"/>
        <xs:enumeration value="TC"/>
        <xs:enumeration value="TD"/>
        <xs:enumeration value="TF"/>
        <xs:enumeration value="TG"/>
        <xs:enumeration value="TH"/>
        <xs:enumeration value="TJ"/>
        <xs:enumeration value="TK"/>
        <xs:enumeration value="TL"/>
        <xs:enumeration value="TM"/>
        <xs:enumeration value="TN"/>
        <xs:enumeration value="TO"/>
        <xs:enumeration value="TR"/>
        <xs:enumeration value="TT"/>
        <xs:enumeration value="TV"/>
        <xs:enumeration value="TW"/>
        <xs:enumeration value="TZ"/>
        <xs:enumeration value="UA"/>
        <xs:enumeration value="UG"/>
        <xs:enumeration value="UM"/>
        <xs:enumeration value="US"/>
        <xs:enumeration value="UY"/>
        <xs:enumeration value="UZ"/>
        <xs:enumeration value="VA"/>
        <xs:enumeration value="VC"/>
        <xs:enumeration value="VE"/>
        <xs:enumeration value="VG"/>
        <xs:enumeration value="VI"/>
        <xs:enumeration value="VN"/>
        <xs:enumeration value="VU"/>
        <xs:enumeration value="WF"/>
        <xs:enumeration value="WS"/>
        <xs:enumeration value="YE"/>
        <xs:enumeration value="YT"/>
        <xs:enumeration value="ZA"/>
        <xs:enumeration value="ZM"/>
        <xs:enumeration value="ZW"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="latitude">
    <xs:annotation>
      <xs:documentation>
        The latitude that corresponds to the location of the listing.
        For example, the latitude for 1600 Amphitheatre Parkway,
        Mountain View, CA 94043 is 37.423738.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:float">
        <xs:minInclusive value="-90.0"/>
        <xs:maxInclusive value="90.0"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="longitude">
    <xs:annotation>
      <xs:documentation>
        The longitude that corresponds to the location of the listing.
        For example, the latitude for 1600 Amphitheatre Parkway,
        Mountain View, CA 94043 is -122.090101.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:float">
        <xs:minInclusive value="-180.0"/>
        <xs:maxInclusive value="180.0"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="locationinfo">
    <xs:annotation>
      <xs:documentation>
        Flags about the location of the listing.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:attributeGroup ref="attlist.locationinfo"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.locationinfo">
    <xs:attribute name="geocode">
      <xs:annotation>
        <xs:documentation>
          Additional information about the geocode.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="verified">
            <xs:annotation>
              <xs:documentation>
                Indicates that the latlong of the business was
                verified / moved to the right place.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="phone">
    <xs:annotation>
      <xs:documentation>
        The phone number of the business.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.phone"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.phone">
    <xs:attribute name="type" use="required">
      <xs:annotation>
        <xs:documentation>
          The type of the phone number.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="main">
            <xs:annotation>
              <xs:documentation>
                Main voice telephone number.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="tollfree">
            <xs:annotation>
              <xs:documentation>
                Toll free telephone number.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="fax">
            <xs:annotation>
              <xs:documentation>
                Fax telephone number.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="tdd">
            <xs:annotation>
              <xs:documentation>
                Telecommunications Device for the Deaf telephone number.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="mobile">
            <xs:annotation>
              <xs:documentation>
                Mobile telephone number.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="switzerland_compliance_no_cold_calls">
      <xs:annotation>
        <xs:documentation>
          This attribute is specifically for compliance with regulations
          in Switzerland. According to Swiss law, businesses can request
          that their phone numbers must not be used for cold calls. Direct
          marketers must honor this request. YP providers must mark these
          number in their directories.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="true">
            <xs:annotation>
              <xs:documentation>
                The business does not want to receive cold calls on this
                number.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="false">
            <xs:annotation>
              <xs:documentation>
                The business does not object to cold calls on this number.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="switzerland_compliance_premium_rate_label">
      <xs:annotation>
        <xs:documentation>
          This attribute is specifically for compliance with regulations
          in Switzerland. According to Swiss law, premium rate numbers must be
          labelled with its per minute cost. If the attribute exists, then its
          value must conform to the format "(CHF x.xx/Min.)", for example
          "(CHF 1.19/Min.)". The whole feed will be rejected if it contains
          even a single premium_rate_label that does not conform to the format.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="category">
    <xs:annotation>
      <xs:documentation>
        The category that the listing belongs to (based on your site's
        taxonomy). Example: Restaurants - Chinese
        One listing can contain any number of categories
        in any number of languages.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:simpleContent>
        <xs:extension base="category.content">
          <xs:attribute ref="xml:lang">
            <xs:annotation>
              <xs:documentation>
                Defines the language of the current category.
                If it is missing then the global language is used
                (defined in listings -> language). It is a good practice
                to leave out this attribute if all the categories are
                in the same language.
              </xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="category.content">
    <xs:restriction base="xs:string">
      <xs:minLength value="1"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="content">
    <xs:annotation>
      <xs:documentation>
        Encapsulates all the content relevant to a listing.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="text"/>
        <xs:element ref="review"/>
        <xs:element ref="image"/>
        <xs:element ref="attributes"/>
        <xs:element ref="coupon"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="text">
    <xs:annotation>
      <xs:documentation>
        Encapsulates a block of text about the listing such as a
        description or a restaurant menu.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="link"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="altlink"/>
        <xs:element minOccurs="0" ref="title"/>
        <xs:element minOccurs="0" ref="author"/>
        <xs:element ref="body"/>
        <xs:element minOccurs="0" ref="date"/>
      </xs:sequence>
      <xs:attributeGroup ref="attlist.text"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.text">
    <xs:attribute name="type">
      <xs:annotation>
        <xs:documentation>
          The type of the text.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="description">
            <xs:annotation>
              <xs:documentation>
                If the contents are a general description of the business.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="offer">
            <xs:annotation>
              <xs:documentation>
                If the contents are an offer or coupon.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="menu">
            <xs:annotation>
              <xs:documentation>
                If the contents are are a restaurant menu.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="review">
    <xs:annotation>
      <xs:documentation>
        Encapsulates a single review of the listing.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="link"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="altlink"/>
        <xs:element minOccurs="0" ref="title"/>
        <xs:element minOccurs="0" ref="author"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="rating"/>
        <xs:element ref="body"/>
        <xs:element minOccurs="0" ref="date"/>
      </xs:sequence>
      <xs:attributeGroup ref="attlist.review"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.review">
    <xs:attribute name="type" use="required">
      <xs:annotation>
        <xs:documentation>
          The type of the review.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="editorial">
            <xs:annotation>
              <xs:documentation>
                Review was written by a member of your staff.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
          <xs:enumeration value="user">
            <xs:annotation>
              <xs:documentation>
                Review was written by a user of your site.
              </xs:documentation>
            </xs:annotation>
          </xs:enumeration>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="image">
    <xs:annotation>
      <xs:documentation>
        Encapsulates an image relevant to the listing.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="link"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="altlink"/>
        <xs:element minOccurs="0" ref="title"/>
        <xs:element minOccurs="0" ref="author"/>
        <xs:element minOccurs="0" ref="date"/>
      </xs:sequence>
      <xs:attributeGroup ref="attlist.image"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.image">
    <xs:attribute name="type" use="required">
      <xs:annotation>
        <xs:documentation>The image type.</xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="ad"/>
          <xs:enumeration value="coupon"/>
          <xs:enumeration value="menu"/>
          <xs:enumeration value="photo"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="url" type="xs:anyURI" use="required">
      <xs:annotation>
        <xs:documentation>The URL of the full-sized image</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="width" type="xs:unsignedInt">
      <xs:annotation>
        <xs:documentation>The width of the image</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="height" type="xs:unsignedInt">
      <xs:annotation>
        <xs:documentation>The height of the image</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="attributes">
    <xs:annotation>
      <xs:documentation>
        Encapsulates a set of attributes about the listing. All attributes
        must be displayed on a single page on your site. If you have
        multiple pages that contain attributes, then include each page as
        a separate attributes tag.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" ref="link"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="altlink"/>
        <xs:element minOccurs="0" ref="title"/>
        <xs:element minOccurs="0" ref="author"/>
        <xs:element minOccurs="0" ref="email"/>
        <xs:element minOccurs="0" ref="website"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="attr"/>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="hiddenattr"/>
        <xs:element minOccurs="0" ref="date"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="attr">
    <xs:annotation>
      <xs:documentation>
        A single piece of structured information about the listing.
        For example, if the name is Business Hours then the value can
        be Mon-Fri 9am-5pm. If the name is Payment Types Accepted,
        then the value can be Cash, Visa, Mastercard. Use the names and
        values that appear on your site.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.attr"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.attr">
    <xs:attribute name="name" use="required">
      <xs:annotation>
        <xs:documentation>
          The name of the field displayed on your site.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="priority" type="xs:integer">
      <xs:annotation>
        <xs:documentation>
          The importance of the fact, which may effect the order
          in which facts are displayed in search results.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="hiddenattr">
    <xs:annotation>
      <xs:documentation>
        A single piece of structured information about the listing,
        which should be hidden from users, because it is used for some
        internal purpose.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.hiddenattr"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.hiddenattr">
    <xs:attribute name="name" use="required">
      <xs:annotation>
        <xs:documentation>
          The name of the hidden field.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="link" type="xs:anyURI">
    <xs:annotation>
      <xs:documentation>
        The URL of the page on your site that contains the content. We will
        link the teaser on Google Local to this page.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:element name="altlink">
    <xs:annotation>
      <xs:documentation>
        The URL of the mobile page that contains the content. 
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:simpleContent>
        <xs:extension base="xs:anyURI">
          <xs:attributeGroup ref="altlinklist.attr"/>
        </xs:extension>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="altlinklist.attr">
    <xs:attribute name="operator">
      <xs:annotation>
        <xs:documentation>
          The name of mobile operator.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="jp-ntt_docomo"/>
          <xs:enumeration value="jp-kddi_au"/>
          <xs:enumeration value="jp-softbank"/>
          <xs:enumeration value="jp-default"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="markup">
      <xs:annotation>
         <xs:documentation>
          The markup language of mobile website.
         </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="chtml"/>
          <xs:enumeration value="html"/>
          <xs:enumeration value="wml"/>
          <xs:enumeration value="xhtml"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="title">
    <xs:annotation>
      <xs:documentation>
        A short summary of the content.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="author">
    <xs:annotation>
      <xs:documentation>
        The name of the author of the content. The value can either be
        a user name or a full name in the format "Firstname Lastname".
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="body">
    <xs:annotation>
      <xs:documentation>
        The entire text of a review or description of the listing. Can
        contain escaped HTML
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="website" type="xs:anyURI">
    <xs:annotation>
      <xs:documentation>
        The official website of the business.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:element name="email">
    <xs:annotation>
      <xs:documentation>
        An email address associated with a business listing.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="[a-zA-Z_0-9\+\.\-@]+"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="rating">
    <xs:annotation>
      <xs:documentation>
        If applicable, the rating score associated with the review. The value
        should reflect how the rating appears on your site. If there are
        multiple ratings for a single review, then use a separate rating tag
        for each rating.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.rating"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.rating">
    <xs:attribute name="name">
      <xs:annotation>
        <xs:documentation>
          Type of the rating such as "Service" or "Food Quality". If there is
          only one rating score in the review, then name may be omitted.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="date">
    <xs:annotation>
      <xs:documentation>
        The date the listing or piece of content was created.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.date"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.date">
    <xs:attribute name="year" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:unsignedInt">
          <xs:minInclusive value="1990"/>
          <xs:maxInclusive value="2099"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="month" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:unsignedInt">
          <xs:minInclusive value="1"/>
          <xs:maxInclusive value="12"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="day">
      <xs:simpleType>
        <xs:restriction base="xs:unsignedInt">
          <xs:minInclusive value="1"/>
          <xs:maxInclusive value="31"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="coupon">
    <xs:annotation>
      <xs:documentation>
        Structured coupon information.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element minOccurs="0" ref="offer"/>
        <xs:element minOccurs="0" ref="details"/>
        <xs:element minOccurs="0" ref="link"/>
        <xs:element minOccurs="0" ref="start_date"/>
        <xs:element minOccurs="0" ref="end_date"/>
        <xs:element minOccurs="0" ref="expiry_date"/>
        <xs:element minOccurs="0" ref="redeem"/>
        <xs:element minOccurs="0" ref="business_name"/>
        <xs:element minOccurs="0" ref="expiry_period"/>
        <xs:element minOccurs="0" ref="merchant_offer_id"/>
        <xs:element minOccurs="0" name="image_url" type="xs:anyURI">
          <xs:annotation>
            <xs:documentation>
              A URL to fetch a PNG, JPG, or GIF image to appear in the coupon.
              The image should be 120x120, but will be proportionately resized
              if it is larger than this.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element minOccurs="0" name="searchable" type="xs:boolean" default="true">
          <xs:annotation>
            <xs:documentation>
              Whether the coupon can be discovered by search.  Setting this
              value to false means that the content will not be included in
              the index.  This allows the provider some control of how the
              coupon is promoted.  E.g, they might be excluded from the index,
              but accessible via ads.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="club_card"/>
        <xs:element minOccurs="0" ref="barcode"/>
        <xs:element minOccurs="0" ref="provider_info">
          <xs:annotation>
            <xs:documentation>
              Defines data about the coupon feed provider.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
      <xs:attributeGroup ref="attlist.coupon"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="business_name">
    <xs:annotation>
      <xs:documentation>
        The name of the business as it should appear on the coupon.  This is
        useful when coupons are shared between related businesses, but the
        business name on the coupon should not differ.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
        <xs:maxLength value="60"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="merchant_offer_id">
    <xs:annotation>
      <xs:documentation>
        This is printed on the coupon, and is used for clerks to 
        recognize the offer and enter it into a point of sale system.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:minLength value="1"/>
        <xs:maxLength value="30"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:attributeGroup name="attlist.coupon">
    <xs:attribute name="id">
      <xs:annotation>
        <xs:documentation>
           Unique coupon id. Coupon elements from the same coupon provider
           must have different coupon id.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="idref">
      <xs:annotation>
        <xs:documentation>
           Refers to another coupon in the feed, one that is defined earlier
           in the feed file.  The idref value must match the id of an earlier
           defined coupon.  A coupon may have an idref, an id or both.

           Having an id without an idref indicates that the coupon is
           standalone, and does not inherit fields from any other coupon.
           Having an idref without an id indicates the coupon inherits its
           fields from the referenced coupon, and keeps the id of the referred
           coupon.  Having both means that the coupon inherits its fields, but
           uses the new id.

           When an idref is used, the referenced coupon must be in either the
           shared content or the current listing.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="offer" type="xs:string">
    <xs:annotation>
      <xs:documentation>
        Succinct summary of offer and major restrictions.
        For example: "$5 off large pizza".
        The offer is required for all coupons, though this is not enforced by
        the XSD because coupons may be defined by reference to other coupons,
        in which case the offer does not need to be supplied.
      </xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:element name="details">
    <xs:annotation>
      <xs:documentation>
        Detailed descriptions of the coupon restrictions.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" name="detail"
            type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="start_date">
    <xs:annotation>
      <xs:documentation>
        The first day on which the coupon can be used.
        The coupon will not be displayed before this date.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.date"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="expiry_date">
    <xs:annotation>
      <xs:documentation>
        The last day on which the coupon can be used.
        The coupon will not be displayed after this date.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.date"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="end_date">
    <xs:annotation>
      <xs:documentation>
        The last date on which the coupon can be presented.  It is optional.
        This will be printed on the coupon.  It is optional.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.date"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="expiry_period">
    <xs:annotation>
      <xs:documentation>
        The number of days after printing that a coupon is valid.  It is
        optional.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:int">
        <xs:minInclusive value="0"/>
        <xs:maxInclusive value="999"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="redeem">
    <xs:annotation>
      <xs:documentation>
      </xs:documentation>
    </xs:annotation>
    <xs:complexType mixed="true">
      <xs:attributeGroup ref="attlist.redeem"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.redeem">
    <xs:attribute name="desktop">
      <xs:annotation>
        <xs:documentation>
           If the coupon can't be redeemed from a PC, this field
           must be 'no' . Default value is 'yes'.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="yes"/>
          <xs:enumeration value="no"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="mobile">
      <xs:annotation>
        <xs:documentation>
          If the coupon can't be redeemed from a mobile phone, this field
          must be 'no'. Default value is 'yes'.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="yes"/>
          <xs:enumeration value="no"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:element name="provider_info">
    <xs:annotation>
      <xs:documentation>
        Information about the organization providing coupon information.  This
        is typically only provided by third party providers who are providing
        listings coupons, and wish to apply their own branding to coupons.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="provider_name" minOccurs="0">
          <xs:annotation>
             <xs:documentation>
               The name of coupon provider organization.
             </xs:documentation>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:minLength value="1"/>
              <xs:maxLength value="25"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element name="provider_logo" type="xs:anyURI" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
               The URL for the logo of your organization.  This should be a
               GIF, JPG, or PNG image, and is allowed to be up to 100 pixels
               wide and 21 pixels high.  It may not contain animation.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="provider_url" type="xs:anyURI" minOccurs="0">
          <xs:annotation>
            <xs:documentation>
              The URL of the website for the coupon provider organization.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="barcode">
    <xs:annotation>
      <xs:documentation>
        Supported barcode types.  Each type has restrictions on
        the type and amount of data that can be encoded.  At most two
        barcodes are allowed for each coupon.  In addition, there is
        a limit on the total amount of data that can be encoded in barcodes
        on a coupon.  This limit depends on the the rendering style of the
        coupon, but is currently set at 32 bytes.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="2">
        <xs:element ref="UPC_A"/>
        <xs:element ref="EAN_13"/>
        <xs:element ref="UCC_EAN_128"/>
        <xs:element ref="CODE_128"/>
        <xs:element ref="CODE_39"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>

  <xs:element name="UPC_A">
    <xs:annotation>
      <xs:documentation>
        UPC-A barcode data.  This consists of a total of 11 or 12 decimal
        digits.  The optional last digit is a check digit.  If it is not
        supplied then we will calculate it.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="[0-9]{11}[0-9]?"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="EAN_13">
    <xs:annotation>
      <xs:documentation>
        EAN-13 barcode data.  This consists of a total of 12 or 13 decimal
        digits, with the first two digits being a number system that
        corresponds to coupons in the appropriate locale.  The last digit is
        an optional check digit (if not supplied, we will supply it).
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="[0-9]{12}[0-9]?"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="UCC_EAN_128">
    <xs:annotation>
      <xs:documentation>
        EAN-128 barcode data, also known as GS1-128.  The specification of
        these is beyond the scope of this document, and the supplier should
        refer to the UCC standard.  Formats 1-4 are supported.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="(8100[0-9]{6}(21[0-9]+)?)|(8101[0-9]{10}(21[0-9]+)?)|(8102[0-9]{2})"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="CODE_128">
    <xs:annotation>
      <xs:documentation>
        Code 128 barcode data.  The payload consists of up to 32 ascii
        characters.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="\p{IsBasicLatin}{1,32}"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="CODE_39">
    <xs:annotation>
      <xs:documentation>
         Code 39 barcode data using up to 20 characters from a restricted
         character set.  No checksum is required in the data.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleType>
      <xs:restriction base="xs:string">
        <xs:pattern value="[0-9A-Z ]{1,20}"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>

  <xs:element name="club_card">
    <xs:annotation>
      <xs:documentation>
      Retailer's club card for coupon redemption.  This is an experimental
      feature, and is not to be used by LEC feed partners without express
      agreement from Google.
      </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="1" name="card_name">
          <xs:annotation>
            <xs:documentation>
            Display name of the club card
            </xs:documentation>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:minLength value="1"/>
              <xs:maxLength value="30"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element minOccurs="1" maxOccurs="1" name="card_logo_url" type="xs:anyURI">
          <xs:annotation>
            <xs:documentation>
            URL for the logo of the club card.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" name="add_to_card_message">
          <xs:annotation>
            <xs:documentation>
            Message text for call to action to add to club card (e.g. "Add to
            Card")
            </xs:documentation>
          </xs:annotation>
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:minLength value="1"/>
              <xs:maxLength value="60"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element minOccurs="1" maxOccurs="1" name="add_to_card_url" type="xs:anyURI">
          <xs:annotation>
            <xs:documentation>
            URL for handling user's action to add coupon to club card.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" name="business_logo_url" type="xs:anyURI">
          <xs:annotation>
            <xs:documentation>
            URL for the store logo.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
      <xs:attributeGroup ref="attlist.club_card"/>
    </xs:complexType>
  </xs:element>

  <xs:attributeGroup name="attlist.club_card">
    <xs:attribute name="id">
      <xs:annotation>
        <xs:documentation>
           Club card id.
        </xs:documentation>
      </xs:annotation>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="[\.0-9a-zA-Z\-%$]{1,60}"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="idref">
      <xs:annotation>
        <xs:documentation>
           Refers to another club card in the feed, one that is defined
           earlier in the feed file.  A club card may have an idref, an id or
           both.

           Having an id without an idref indicates that the card is
           standalone, and does not inherit fields from any other card.
           Having an idref without an id indicates the card inherits its
           fields from the referenced card, and keeps the id of the referred
           card.  Having both means that the card inherits its fields, but
           uses the new id.

           When an idref is used, the referenced card must be in either the
           shared content or the current listing.
        </xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:attributeGroup>

</xs:schema>
