tudelft3d / CityGML-schema-validation

small script to validate a CityGML file against the XSD schemas of CityGML (all versions supported)
MIT License
11 stars 3 forks source link

Is the script the same as the webpage? #1

Closed balazsdukai closed 6 years ago

balazsdukai commented 6 years ago

Validating the attached file gives the traceback below, while doing the same on the webpage gives the expected error Invalid CityGML document: not a CityGML document.. Are the two the same thing, or there is a different software behind the webpage?

Traceback (most recent call last):
  File "valxsdcitygml.py", line 117, in <module>
    main()
  File "valxsdcitygml.py", line 16, in main
    validateonefile(sys.argv[1])
  File "valxsdcitygml.py", line 20, in validateonefile
    doc, xsd = getXML(fIn)
  File "valxsdcitygml.py", line 79, in getXML
    doc = etree.parse(fIn)    
  File "src/lxml/lxml.etree.pyx", line 3427, in lxml.etree.parse (src/lxml/lxml.etree.c:85131)
  File "src/lxml/parser.pxi", line 1782, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:124005)
  File "src/lxml/parser.pxi", line 1808, in lxml.etree._parseDocumentFromURL (src/lxml/lxml.etree.c:124374)
  File "src/lxml/parser.pxi", line 1712, in lxml.etree._parseDocFromFile (src/lxml/lxml.etree.c:123169)
  File "src/lxml/parser.pxi", line 1115, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:117533)
  File "src/lxml/parser.pxi", line 573, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:110510)
  File "src/lxml/parser.pxi", line 683, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:112276)
  File "src/lxml/parser.pxi", line 613, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:111124)
lxml.etree.XMLSyntaxError: Namespace prefix bldg on Building is not defined, line 6, column 17

invalid_citygml_2.gml.zip

hugoledoux commented 6 years ago

one try/except was missing in repo version... the code is a bit different b/c web-version needs to return something and not console prints...

anyway, fixed 792ac59f76160674f14ad74f0cf02308b9a739d9

thanks!