May-06-2018, 09:52 AM
You are printing just the last entry in the loop because the print in line 49 is outside the loop in line 41.
for obj in publication_objects: name = obj.find('d:PublicationObjectName', ns).text data = obj.find('d:PublicationObjectData/d:CLSPublicationObjectDataBE', ns) applicable_at = data.find('d:ApplicableAt', ns).text applicable_for = data.find('d:ApplicableFor', ns).text value = float(data.find('d:Value', ns).text) # Report each entry print(name,applicable_at,applicable_for,value)Either move it inside or collect the parts in lists (or your favourite data structure) and write them later.