I have had a question about Elemttree parsing before and it was answered the next day. I am still not a pro in python and therefore need help once more.
<MiddleCommand xsi:type="SetEndPoseToleranceType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CommandID>19827</CommandID>
<Tolerance>
<XPointTolerance>3.0</XPointTolerance>
<YPointTolerance>3.0</YPointTolerance>
<ZPointTolerance>2.0</ZPointTolerance>
<XAxisTolerance>2.0</XAxisTolerance>
<ZAxisTolerance>2.0</ZAxisTolerance>
</Tolerance>
</MiddleCommand>
<MiddleCommand xsi:type="MoveToType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CommandID>19828</CommandID>
<MoveStraight>false</MoveStraight>
<EndPosition>
<Point>
<X>528.65</X>
<Y>33.8</Y>
<Z>50.0</Z>
</Point>
<XAxis>
<I>-0.7071067811865475</I>
<J>-0.7071067811865477</J>
<K>-0.0</K>
</XAxis>
<ZAxis>
<I>0.0</I>
<J>0.0</J>
<K>-1.0</K>
</ZAxis>
</EndPosition>
</MiddleCommand>
This is part of my XML file. I have been able to get my Values from different Command types and write them into classes. The only thing that i cant manage to do is. I want an array with Commands. So that i know the order which one is the first to happen So ultimately the array should look something like this:
Array_Commands = []
Array_Commands[0] = SetEndPoseToleranceType
Array_Commands[1] = MoveToType
Obviously I want to loop through the XML and not create the Array by hand. I dont have any code regarding this problem so far.
I hope someone knows a simple solution. Best regard and thank you all!