I have fetched all the message names and signal names from the dbc using Python in the format shown below in a txt file:
MessageName1
Signal_Name1
MessageName2
Signal_Name2
Signal_Name3
MessageName3
Signal_Name4
Signal_Name5
Signal_Name6
Each and every message is separated by space, which is shown above. Can any one please explain how to produce an XML file in the format below using Element Tree in Python?
<namespace name="MessageName1" comment="" interface="">
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Signal_Name1" comment="" bitcount="64" isSigned="true" encoding="65001" type="float" />
</namespace>
<namespace name="MessageName2" comment="" interface="">
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Signal_Name2" comment="" bitcount="64" isSigned="true" encoding="65001" type="float" />
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Signal_Name3" comment="" bitcount="64" isSigned="true" encoding="65001" type="float" />
</namespace>
and so on.