Hello everybody,

I'm trying to parse Google-Maps  XML response using JAXB. As I didn't
found any XML schema for it I generated it by myself. Below is the
response XML I used for generation and the generated XML schema. The
request was

http://maps.google.com/maps/geo?q=stuttgarterstr.&key=mykey&output=xml

During unmarshaling I get an error

javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: Premature end of file.]

When I try to validate the XML and schema using for example
http://tools.decisionsoft.com/schemaValidate/ I get an error

Cannot find the declaration of element 'kml'.

But it declared!

Has anybody any Idea where I can get the Google XML schema for its
response?

Many thanks and best regards,
Andrej

==================== XML response ===========================

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0";>
    <Response>
        <name>stuttgarterstr.</name>
        <Status>
            <code>200</code>
            <request>geocode</request>
        </Status>
        <Placemark id="p1">
            <address>Stuttgarter Stra�e, 74321 Bietigheim,
Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Ludwigsburg</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Bietigheim</
LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                                <PostalCode>
                                    <PostalCodeNumber>74321</
PostalCodeNumber>
                                </PostalCode>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.138957,48.948959,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p2">
            <address>Stuttgarter Stra�e, 73230 Kirchheim unter Teck,
Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Esslingen</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Kirchheim unter Teck</
LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                                <PostalCode>
                                    <PostalCodeNumber>73230</
PostalCodeNumber>
                                </PostalCode>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.428724,48.655327,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p3">
            <address>Stuttgarter Stra�e, Ulm, Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Ulm</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Ulm</LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.982036,48.428515,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p4">
            <address>Stuttgarter Stra�e, Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <Thoroughfare>
                            <ThoroughfareName>Stuttgarter Stra�e</
ThoroughfareName>
                        </Thoroughfare>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.049326,48.788974,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p5">
            <address>Stuttgarter Stra�e, 74172 Neckarsulm,
Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Heilbronn LK</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Neckarsulm</
LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                                <PostalCode>
                                    <PostalCodeNumber>74172</
PostalCodeNumber>
                                </PostalCode>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.236041,49.201162,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p6">
            <address>Stuttgarter Stra�e, G�ppingen, Deutschland</
address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>G�ppingen</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>G�ppingen</LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.629562,48.710673,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p7">
            <address>Stuttgarter Stra�e, 71638 Ludwigsburg,
Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Ludwigsburg</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Ludwigsburg</
LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                                <PostalCode>
                                    <PostalCodeNumber>71638</
PostalCodeNumber>
                                </PostalCode>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.194712,48.887675,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p8">
            <address>Stuttgarter Stra�e, Fellbach, Deutschland</
address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Rems-Murr-
Kreis</SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Fellbach</LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>9.263998,48.812197,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p9">
            <address>Stuttgarter Stra�e, Aalen, Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Ostalbkreis</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Aalen</LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>10.086924,48.831786,0</coordinates>
            </Point>
        </Placemark>
        <Placemark id="p10">
            <address>Stuttgarter Stra�e, 72280 Dornstetten,
Deutschland</address>
            <AddressDetails Accuracy="6"
xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0">
                <Country>
                    <CountryNameCode>DE</CountryNameCode>
                    <AdministrativeArea>
                        <AdministrativeAreaName>Baden-W�rttemberg</
AdministrativeAreaName>
                        <SubAdministrativeArea>
                            <SubAdministrativeAreaName>Freudenstadt</
SubAdministrativeAreaName>
                            <Locality>
                                <LocalityName>Dornstetten</
LocalityName>
                                <Thoroughfare>
                                    <ThoroughfareName>Stuttgarter
Stra�e</ThoroughfareName>
                                </Thoroughfare>
                                <PostalCode>
                                    <PostalCodeNumber>72280</
PostalCodeNumber>
                                </PostalCode>
                            </Locality>
                        </SubAdministrativeArea>
                    </AdministrativeArea>
                </Country>
            </AddressDetails>
            <Point>
                <coordinates>8.487171,48.481814,0</coordinates>
            </Point>
        </Placemark>
    </Response>
</kml>

==================== end of XML response ======================




==================== XML schema ============================

<?xml version="1.0" encoding="UTF-8" ?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
  <xs:element name="address">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="AddressDetails">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Country" />
      </xs:sequence>
      <xs:attribute name="Accuracy" type="xs:NMTOKEN" use="required"
fixed="6" />
    </xs:complexType>
  </xs:element>

  <xs:element name="AdministrativeArea">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="AdministrativeAreaName" />
        <xs:element ref="SubAdministrativeArea" />
        <xs:element ref="Thoroughfare" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="AdministrativeAreaName">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="code">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="coordinates">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="Country">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="CountryNameCode" />
        <xs:element ref="AdministrativeArea" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="CountryNameCode">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="kml">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Response" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="Locality">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="LocalityName" />
        <xs:element ref="Thoroughfare" />
        <xs:element ref="PostalCode" minOccurs="0" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="LocalityName">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="name">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="Placemark">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="address" />
        <xs:element ref="AddressDetails" />
        <xs:element ref="Point" />
      </xs:sequence>
      <xs:attribute name="id" type="xs:NMTOKEN" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="Point">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="coordinates" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="PostalCode">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="PostalCodeNumber" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="PostalCodeNumber">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="request">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="Response">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="name" />
        <xs:element ref="Status" />
        <xs:element ref="Placemark" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="Status">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="code" />
        <xs:element ref="request" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="SubAdministrativeArea">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="SubAdministrativeAreaName" />
        <xs:element ref="Locality" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="SubAdministrativeAreaName">
    <xs:complexType mixed="true" />
  </xs:element>

  <xs:element name="Thoroughfare">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="ThoroughfareName" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="ThoroughfareName">
    <xs:complexType mixed="true" />
  </xs:element>

</xs:schema>


==================== end of XML schema =======================
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to