How to Extract data asocaited with attribute of XML file using python 3.2
Posted
by
user1460383
on Stack Overflow
See other posts from Stack Overflow
or by user1460383
Published on 2012-06-16T09:11:40Z
Indexed on
2012/06/16
9:16 UTC
Read the original article
Hit count: 445
python
|xml-parsing
I have this xml format.....
<event timestamp="0.447463" bustype="LIN" channel="LIN 1">
<col name="Time"/>
<col name="Start of Frame">0.440708</col>
<col name="Channel">LIN 1</col>
<col name="Dir">Tx</col>
<col name="Event Type">LIN Frame (Diagnostic Request)</col>
<col name="Frame Name">MasterReq_DB</col>
<col name="Id">3C</col>
<col name="Data">81 06 04 04 FF FF 50 4C</col>
<col name="Publisher">TestMaster (simulated)</col>
<col name="Checksum">D3 "Classic"</col>
<col name="Header Duration">2.090 ms (40.1 bits)</col>
<col name="Resp. Duration">4.688 ms (90.0 bits)</col>
<col name="Time difference">0.049987</col>
<empty/>
</event>
In above xml, i need to extract data associated with attribute 'name'
Am able to get all names but am unable to fetch >MasterReq_DB< field
Please help me ...
Thanks in advance
© Stack Overflow or respective owner