| 1 |
Upgrading from older versions of FastKML |
| 2 |
======================================== |
| 3 |
|
| 4 |
Q: I updated from 0.12 to 1.0.0 and now getting the following errors when using |
| 5 |
``parse()``:: |
| 6 |
|
| 7 |
File "src/lxml/etree.pyx", line 3701, in lxml.etree._Validator.assert_ |
| 8 |
AssertionError: Element ... |
| 9 |
|
| 10 |
A: Your KML does not validate against the XML Schema. |
| 11 |
You can read it without validations by passing ``validate=False`` or ``strict=False`` |
| 12 |
to the parse method:: |
| 13 |
|
| 14 |
from fastkml.kml import KML |
| 15 |
doc = KML.parse('path/to/your/file.kml', strict=False) |
| 16 |
# or |
| 17 |
doc = KML.parse('path/to/your/file.kml', validate=False) |
| 18 |
|
| 19 |
With version 1.0, ``.from_string()`` is a class method that returns a new object. |
| 20 |
|
| 21 |
In fastkml 0.x:: |
| 22 |
|
| 23 |
postcode_kml = kml.KML() |
| 24 |
postcode_kml.from_string(kml_file.read()) |
| 25 |
|
| 26 |
Becomes in 1.0:: |
| 27 |
|
| 28 |
postcode_kml = kml.KML.from_string(kml_file.read()) |