title: Is there a way to parse a XML according to its attributes?
body: <p>I'm trying to parse my xml using minidom.parse but the program crushes when debugger reaches line  <code>xmldoc = minidom.parse(self)</code></p>
  
  <p>Here is what have I tried:</p>
  
  <pre><code>attribValList = list()
  xmldoc = minidom.parse(path)
  equipments = xmldoc.getElementsByTagName(xmldoc , elementName)
  equipNames = equipments.getElementsByTagName(xmldoc , attributeKey)
  for item in equipNames:
      attribValList.append(item.value)
  
  return attribValList
  </code></pre>
  
  <p>Maybe my XML is too specific for minidom. Here is how it looks like:</p>
  
  
  
  <pre><code>&lt;TestSystem id="..."&gt;
      &lt;Port&gt;58&lt;/Port&gt;
      &lt;TestSystemEquipment&gt;
          &lt;Equipment type="BCAFC"&gt;
              &lt;Name&gt;System1&lt;/Name&gt;
              &lt;DU-Junctions&gt;
                  ...
              &lt;/DU-Junctions&gt;
          &lt;/Equipment&gt;
  </code></pre>
  
  <p>Basically I need to get for each <code>Equipment</code> its name and write the names into a list.</p>
  
  <p>Can anybody tell what I'm doing wrong?</p>
  
  <p><a href="https://i.stack.imgur.com/91XMB.png" rel="nofollow noreferrer">enter image description here</a></p>