sanand0 / xmljson

xmlsjon converts XML into Python dictionary structures (trees, like in JSON) and vice-versa.
MIT License
121 stars 33 forks source link

unclosed token: line 191784 #43

Closed odo2063 closed 4 years ago

odo2063 commented 4 years ago

Hi!

I am getting an error when parsing a file:

$ xml2json -o test.json lod1_33358-5804_geb.gml

Traceback (most recent call last):
  File "/usr/local/bin/xml2json", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/xmljson/__main__.py", line 39, in main
    json.dump(dialect.data(parse(in_file).getroot()), out_file, indent=2)
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1196, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 597, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: unclosed token: line 191784, column 8

The suspected Line is this(the middle one):

<gen:stringAttribute name="MittlereTraufHoehe">
        <gen:value>40.65</gen:value>
</gen:stringAttribute>

The other 16810 files from the Provider are parsed without errors.

odo2063 commented 4 years ago

forget it...was unzip problem...actual file is missing some lines...