Skip to content

Commit

Permalink
Merge pull request #5 from SkyTruth/master
Browse files Browse the repository at this point in the history
Bugfix to handle big files 
8-) thanks a lot
  • Loading branch information
cleder committed Oct 10, 2013
2 parents f6e1f48 + ee66e81 commit 84144cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fastkml/kml.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def __init__(self, ns=None):

def from_string(self, xml_string):
""" create a KML object from a xml string"""
element = etree.XML(xml_string)
if config.LXML:
element = etree.fromstring(xml_string, parser=etree.XMLParser(huge_tree=True))
else:
element = etree.XML(xml_string)

if element.tag.endswith('kml'):
ns = element.tag.rstrip('kml')
documents = element.findall('%sDocument' % ns)
Expand Down

0 comments on commit 84144cc

Please sign in to comment.