Expand|Select|Wrap|Line Numbers
- <?xml version="1.0" ?>
- - <frameNumber4>
- - <v0>
- <X>0.148778095841</X>
- <Y>-0.987688362598</Y>
- <Z>-0.0483409352601</Z>
- </v0>
- - <v1>
- <X>0.126558214426</X>
- <Y>-0.987688362598</Y>
- <Z>-0.0919499248266</Z>
- </v1>
- etc....
so i need to parse this as in im accessing <v0><X>, is this possible?
i know i can do it in a manner where i take the v0 and parse it again to get the X, but i was wondering if there was a more efficient way of direct access to a 2nd level member
on the other hand, i know this should be a really dumb question, but how do i get the value of the element, and not the whole xml, all i know of is the method toxml which gives me the whole <Z>-0.0919499248266</Z>
and here's the code im using so far in case it should come in handy :)
Expand|Select|Wrap|Line Numbers
- from xml.dom.minidom import parse
- dom = parse('D:\\newCache\\pSphere2-004.xml')
- for node in dom.getElementsByTagName('v0'):
- print node.toxml()