Find element with attribute with minidom

Posted by Xster on Stack Overflow See other posts from Stack Overflow or by Xster
Published on 2010-03-10T07:11:21Z Indexed on 2010/03/14 8:45 UTC
Read the original article Hit count: 360

Filed under:
|
|

Given

<field name="frame.time_delta_displayed" showname="Time delta from previous displayed frame: 0.000008000 seconds" size="0" pos="0" show="0.000008000"/>
<field name="frame.time_relative" showname="Time since reference or first frame: 0.000008000 seconds" size="0" pos="0" show="0.000008000"/>
<field name="frame.number" showname="Frame Number: 2" size="0" pos="0" show="2"/>
<field name="frame.pkt_len" showname="Packet Length: 1506 bytes" hide="yes" size="0" pos="0" show="1506"/>
<field name="frame.len" showname="Frame Length: 1506 bytes" size="0" pos="0" show="1506"/>
<field name="frame.cap_len" showname="Capture Length: 1506 bytes" size="0" pos="0" show="1506"/>
<field name="frame.marked" showname="Frame is marked: False" size="0" pos="0" show="0"/>
<field name="frame.protocols" showname="Protocols in frame: eth:ip:tcp:http:data" size="0" pos="0" show="eth:ip:tcp:http:data"/>

How do I get the field with name="frame.len" right away without iterating through every tag and checking the attributes?

© Stack Overflow or respective owner

Related posts about python

Related posts about Xml