This project has moved. For the latest updates, please go here.

Why is root null?

May 7, 2013 at 12:09 AM
Can someone explain what is being checked to get the kml.Root?

I'm using VB.Net 2010 and doing a simple file = KmlFile.Load(filename), followed by a check if file.Root is null. I am processing files from all over the place so have no control of how the file is created. Seems that about half the files have a null root.

Is there a way I can process the files when Root is null?
May 7, 2013 at 12:49 AM
Edited May 7, 2013 at 12:50 AM
It seems that at least part of my problem is due to bad namespaces!

One of the files I was trying to read had a namespace of: xmlns="http://earth.google.com/kml/2.2", another had no namespace.

Following the parsing example referred to on the Documentation page as Legacy Files solved these problems.