Hi guys,

I need to parse CityGML (which is in this case a normal xml) in Python. For this I use ElementTree.
This is perfectly working for normal XML-Files. I can change content, print Tag-attributes etc. But whenever I try to start to take the CityGML-FIle nothing happens...


In this example I just want to try to get a list of the child Tags with the name "creationDate":
Code:
import xml.etree.ElementTree as ET 
tree = ET.parse('Gasometer.xml')
root = tree.getroot()
def child_list(child):                                  
    list_child = list(tree.iter(child))
    return list_child
date = child_list('creationDate')
print (date)
This is a part of the XML-File (The file is full of such ObjectMembers and I want to have the creationDates of them; CityModel ist the Root-Tag of the file)

HTML Code:
<CityModel xmlns="http://www.opengis.net/citygml/1.0" xmlns:tran="http://www.opengis.net/citygml/transportation/1.0" xmlns:wtr="http://www.opengis.net/citygml/waterbody/1.0" xmlns:gml="http://www.opengis.net/gml" xmlns:grp="http://www.opengis.net/citygml/cityobjectgroup/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:luse="http://www.opengis.net/citygml/landuse/1.0" xmlns:frn="http://www.opengis.net/citygml/cityfurniture/1.0" xmlns:app="http://www.opengis.net/citygml/appearance/1.0" xmlns:tex="http://www.opengis.net/citygml/texturedsurface/1.0" xmlns:bldg="http://www.opengis.net/citygml/building/1.0" xmlns:xal="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0" xmlns:dem="http://www.opengis.net/citygml/relief/1.0" xmlns:veg="http://www.opengis.net/citygml/vegetation/1.0" xmlns:gen="http://www.opengis.net/citygml/generics/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/citygml/landuse/1.0 http://schemas.opengis.net/citygml/landuse/1.0/landUse.xsd http://www.opengis.net/citygml/cityfurniture/1.0 http://schemas.opengis.net/citygml/cityfurniture/1.0/cityFurniture.xsd http://www.opengis.net/citygml/appearance/1.0 http://schemas.opengis.net/citygml/appearance/1.0/appearance.xsd http://www.opengis.net/citygml/texturedsurface/1.0 http://schemas.opengis.net/citygml/texturedsurface/1.0/texturedSurface.xsd http://www.opengis.net/citygml/transportation/1.0 http://schemas.opengis.net/citygml/transportation/1.0/transportation.xsd http://www.opengis.net/citygml/waterbody/1.0 http://schemas.opengis.net/citygml/waterbody/1.0/waterBody.xsd http://www.opengis.net/citygml/building/1.0 http://schemas.opengis.net/citygml/building/1.0/building.xsd http://www.opengis.net/citygml/relief/1.0 http://schemas.opengis.net/citygml/relief/1.0/relief.xsd http://www.opengis.net/citygml/vegetation/1.0 http://schemas.opengis.net/citygml/vegetation/1.0/vegetation.xsd http://www.opengis.net/citygml/generics/1.0 http://schemas.opengis.net/citygml/generics/1.0/generics.xsd http://www.opengis.net/citygml/cityobjectgroup/1.0 http://schemas.opengis.net/citygml/cityobjectgroup/1.0/cityObjectGroup.xsd">
  <cityObjectMember>
    <bldg:Building gml:id="UUID_899cac3f-e0b6-41e6-ae30-a91ce51d6d95">
      <gml:description>Wohnblock in geschlossener Bauweise</gml:description>
      <gml:boundedBy>
        <gml:Envelope srsName="urn:ogc:def:crs,crs:EPSG::3068,crs:EPSG::5783" srsDimension="3">
          <gml:lowerCorner>21549.6537889055 17204.3479916992 38.939998626709</gml:lowerCorner>
          <gml:upperCorner>21570.6420902953 17225.660050148 60.6840192923434</gml:upperCorner>
        </gml:Envelope>
      </gml:boundedBy>
      <creationDate>2014-03-28</creationDate>
      <externalReference>
        <informationSystem>LOCATION</informationSystem>
        <externalObject>
          <name>0003000a000af91c</name>
        </externalObject>
      </externalReference>

The only thing I get is an empty list []

What should I do? Hope somebody can help me