Google Earth error: not well formed (invalid token)

3,544 views
Skip to first unread message

Daniel Tiskoski

unread,
Mar 4, 2015, 9:35:10 AM3/4/15
to kml-suppor...@googlegroups.com
Hi everyone!

The errors show in the attached screen capture when i opened the program Google Earth. Could someone help me interpret the error?




Jason M

unread,
Mar 4, 2015, 8:47:05 PM3/4/15
to kml-suppor...@googlegroups.com
Somehow your saved places file got corrupt.

The saved places file (named myplaces.kml) must be a well-formed XML file which is currently it is not

You need to fix the saved places file or restore it from a recent backup.

The location of your saved places file can be found here.

Fortunately the first line has the error. The first 3 lines of a well formed saved places KML should look like this:

<?xml version="1.0" encoding="UTF-8"?>
             xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
...

Load it into a text editor and verify the first lines look like this.

Daniel Tiskoski

unread,
Mar 4, 2015, 9:24:20 PM3/4/15
to kml-suppor...@googlegroups.com
Obriado by return, Jason!
Anyway, I know aondeestá the file "MyPlaces" and every 30 days I keep a copy in the cloud. However, the last copy was the day February 2, 2015 and until yesterday a lot of work had been done. I opened in a text editor the last saved file and did not show anything, all ficoubranca screen. I opened the file and February appeared the following line:
<? Xml version = "1.0" encoding = "UTF-8"?>
<Kml xmlns = "http://www.opengis.net/kml/2.2" xmlns: gx = "http://www.google.com/kml/ext/2.2" xmlns: kml = "http: // www .opengis.net / kml / 2.2 "xmlns: atom =" http://www.w3.org/2005/Atom ">
<Document>
<Style id = "sh_ylw-stars011">
<IconStyle>
<Scale> 1.3 </ scale>
<Icon>
<Href> http://maps.google.com/mapfiles/kml/paddle/ylw-stars.png </ href>
</ Icon>
<Hotspot x = "32" y = "1" xunits = "pixels" yunits = "pixels" />
</ IconStyle>
<ListStyle>
<ItemIcon>
<Href> http://maps.google.com/mapfiles/kml/paddle/ylw-stars-lv.png </ href>
</ ItemIcon>
</ ListStyle>
</ Style>
<StyleMap id = "msn_D34">
<Pair>
<Key> Normal </ key>
<StyleUrl> # sn_D4 </ styleUrl>
</ Pair>
<Pair>
<Key> highlight </ key>
<StyleUrl> #sh_D </ styleUrl>
</ Pair>
</ StyleMap>
<Style id = "sn_wht-pushpin5">
<IconStyle>
<Scale> 1.1 </ scale>
<Icon>
<Href> http://maps.google.com/mapfiles/kml/pushpin/wht-pushpin.png </ href>
</ Icon>
<Hotspot x = "20" y = "2" xunits = "pixels" yunits = "pixels" />
</ IconStyle>

Jason M

unread,
Mar 6, 2015, 8:12:07 AM3/6/15
to kml-suppor...@googlegroups.com
XML is case sensitive and the tags of the first two lines should be lower-case.

<? Xml version = "1.0" encoding = "UTF-8"?>
<Kml xmlns = "...

Should be changed to:

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

Notice no space between ? and xml in first line. 

There are probably also other errors as well.

Quick way to verify the file is well-formed is make a copy of the myplaces.kml file with .xml then drag it on to a web browser.
Any modern web browser will validate XML files and show errors if it fails to parse.

You ahead and try to repair this file but if there are too many errors the last resort might be to restore your most recent backup.

smh

unread,
Mar 6, 2015, 9:09:55 PM3/6/15
to kml-suppor...@googlegroups.com


On Friday, March 6, 2015 at 5:12:07 AM UTC-8, Jason M wrote:
Quick way to verify the file is well-formed is make a copy of the myplaces.kml file with .xml then drag it on to a web browser.
Any modern web browser will validate XML files and show errors if it fails to parse.

I agree with your intent, but in XML territory this is an incorrect use of "validate".   That an XML document can be "parsed" -- that is, all the punctuation is correct, the tags are properly nested, etc. etc.-- is called "well-formedness".  Validation is a much stronger constraint, that the document obeys the Document Type Definition (DTD) or perhaps some other schema, that specifies that in addition to well-formedness the document conforms about which elements and content may appear inside which other elements.

Browsers will certainly report bad syntax, but I don't know of any main line browsers which validate automatically.  In any case, they could only do so if a DTD were included directly in the XML document or referenced by an external URL.

XML is a religion -- it's not a bad religion, but best not to anger the XML gods with <blasphemy satire="true">blasphemy</blasphemy>!

Reply all
Reply to author
Forward
0 new messages