Parse error

1,044 views
Skip to first unread message

GE Gango

unread,
Jul 7, 2009, 5:29:57 PM7/7/09
to KML Developer Support - Advanced Support for KML
Hi

I have a 33 MB my places Google Earth KML file which I can not open
anymore since my Windows Vista Ultime 64 Bit OS went unexpectectly
into hibernation mode.

The file has been renamed as myplaces.broken-30-6-2009 probably by GE.

When I fire up GE and try to load the above mentioned file following
error message appears:

Parse error at line 757235, column 0:

not well-formed (invalid token)


Can somebody help me / teach me how to fix this ??!!


Many thanks in advance!



Roman N

unread,
Jul 14, 2009, 11:54:24 AM7/14/09
to KML Developer Support - Advanced Support for KML
Hi GE Gango,

Since you're in the Advanced Support for KML forum, I'll assume you're
fairly knowledgeable about XML. I'd open the myplaces.broken-...kml
file in a text editor that can handle large files (TextMate, Notepad+
+, vim, etc.) and go to that line and see what's wrong.

My guess is that it's an extra blank line at the end of the file or
just some minor corruption, but you should check it out in a text
editor.

Thanks,
Roman

Roman N

unread,
Jul 14, 2009, 11:55:03 AM7/14/09
to KML Developer Support - Advanced Support for KML
Oh also, if it happens to be a .KMZ, try renaming to .ZIP and
unzipping.

On Jul 7, 5:29 pm, GE Gango wrote:

GE Gango

unread,
Jul 16, 2009, 4:53:53 AM7/16/09
to KML Developer Support - Advanced Support for KML
Hi Roman

Thanks for your quick reply. Using the standard Microsoft Editor I was
able to find the jump to line function. When I type in 757235 it gives
me an error message: (Translated from German) line out of range.
I click ok and the jump to line function changes to a value of 34146.
I tried it several times with the same result. It then jumps to the
very end of the file (apparently 34146). So where the heck is
757235..???

I also assume that it is only a very minor bug - but looking at the
size of the file it seems to me like finding the needle in a haystack!

The most recent back up file is only half the size with 16'383 KB -
Interestingly one line in the myplaces kml file represents exactly 1
KB. For this file it shows 16379 Lines. 34146 for the one being 34'163
KB!
One more thing - when the file is opened with the Text Editor roughly
2/3 of the file is filled with codes and 1/3 is just empty space no
matter how you resize it.

Unfortunately it is not a .kmz file it is a .kml

How shall we proceed from here..?

GE Gango

unread,
Jul 16, 2009, 5:36:47 AM7/16/09
to KML Developer Support - Advanced Support for KML


Hi Roman

I made some progress - with the help of Notepad++ (free download) I
was able

to find line 757235. In fact it is the very last line of the file. It
reads like:

NUL NUL NUL NUL etc.

The whole line is very long and looks the same.

Now what is wrong with it? Where is the parse error?

Roman N

unread,
Jul 16, 2009, 11:59:11 AM7/16/09
to KML Developer Support - Advanced Support for KML
Hi GE Gango,

First, regardless what you do, make sure to backup the file :)

If the file is a .KMZ then you will not be able to open it in Notepad+
+, you'll need to first unzip it.

Otherwise (if it's .KML) make sure that inside that file, there is XML
like <kml xmlns="http://... If you don't see any XML/text, then the
file may be severely corrupted. If the entire file is text but you
only see the NUL NUL NUL at the very end, try deleting that set of
NUL's. The last character in the file should either be one newline or
the '>' in '</kml>'.

Thanks,
Roman

GE Gango

unread,
Jul 17, 2009, 9:06:38 AM7/17/09
to KML Developer Support - Advanced Support for KML


Hi Roman

Don't worry I have more than one back up! I don't want to lose so much
work...

There is xmlns text on like 5 lines - so that is fine. Definately
a .KLM file


I replaced the last line in with: </kml>

Tried to open the file in GE and this is what it shows now:

---------------------------
Parse error at line 757235, column 2:

mismatched tag

There are minus signs on the left like at line 757228, then 757233 all
over the file but they do not make a lot of sense to me. They group
some
of the text and lines.

This is how line 757233 to Line 757235 now look like:


<LineStyle>
<color>ffff0055</color>
</kml>


Obviously the last line 757235 falls also into the category (-) of
757233.

Also most of the text on the lines starts only in the 4th or 5th
column.

What do you reckon?




Roman N

unread,
Jul 17, 2009, 1:17:46 PM7/17/09
to KML Developer Support - Advanced Support for KML
Ah, probably some basic file corruption.. I suggest getting an XML
editor that can list all syntax errors (maybe oXygen or Eclipse) and
then iteratively fixing the errors until the file is well formed.
Ideally the editor would also be able to validate against the KML
schema.

Feel free to ask specific KML/XML questions here as you are fixing the
errors, and good luck!

Thanks,
Roman

GE Gango

unread,
Jul 25, 2009, 11:05:46 AM7/25/09
to KML Developer Support - Advanced Support for KML
I tried the OxygenXML Editor but could not really figure out how to
debug the file.

The tool was struggling with the size of the file - superslow etc.

So basically I am still there where I used to be. It does not work!

I think what I need to know is how to properly end this xml file, what
to cut out etc.

I don't mind losing the last couple of lines or so. So here I am just
copying some of the last lines of the total 757235 again:

Who knows how to end this file so it works?????????????????

<Style id="sn_icon24_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:0_copy:
0_copy:0_copy:0_copy:0_copy51">
<IconStyle>
<color>ff00ffff</color>
<scale>0.5</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon24.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>0.7</scale>
</LabelStyle>
</Style>
<Style id="sn_icon24135230">
<IconStyle>
<color>ff00ffff</color>
<scale>0.5</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pal4/icon24.png</href>
</Icon>
</IconStyle>
<LabelStyle>
<scale>0.7</scale>
</LabelStyle>
</Style>
<Style id="sh_ylw-pushpin61200">
<IconStyle>
<scale>1.3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-
pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
<LineStyle>
<color>ffff0055</color>
NULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNULNUL






Reply all
Reply to author
Forward
0 new messages