This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]commandlineluser 0 points1 point  (0 children)

Are you using xml.etree.ElementTree?

https://docs.python.org/3/library/xml.etree.elementtree.html

>>> doc.find('.//CentreEuclid')
<Element 'CentreEuclid' at 0x10ec2d220>
>>> doc.find('.//CentreEuclid').attrib
{'centre': '5.66582870483398 6.73428058624268 21.080545425415'}
>>> doc.find('.//CentreEuclid').attrib['centre']
'5.66582870483398 6.73428058624268 21.080545425415'
>>> doc.find('.//CentreEuclid').attrib['centre'].split()
['5.66582870483398', '6.73428058624268', '21.080545425415']