title: Python:How to remove file extension from tag name in xml file
body: <pre><code>This is my code
  
  from xml.dom import minidom
  import os, shutil
  os.chdir("E:\\")
  xmldoc = minidom.parse('123.xml')
  itemlist = xmldoc.getElementsByTagName('File') #TagName
  print len(itemlist)
  print itemlist[0].attributes['name'].value
  for s in itemlist :
      shutil.move(s.attributes['name'].value, "E:\\Junk\\") #Moving to another location
  </code></pre>
  
  <p>The above code finds the tag  and gets it value.</p>
  
  <p>My xml file is something like this</p>
  
  <pre><code>&lt;File&gt;
     &lt;File name="E:\qwer\abc.exe"/&gt;
     &lt;File name="E:\qwer\xyz.dll"/&gt;
     &lt;File name="E:\pqr\bc.exe"/&gt;
  &lt;/File&gt;
  </code></pre>
  
  <p>How do I remove the "abc.exe"? Is there any way to search for the extension in the xml and then remove it?
  Final xml should be like this</p>
  
  <pre><code>&lt;File&gt;
     &lt;File name="E:\qwer\"/&gt;
     &lt;File name="E:\qwer\"/&gt;
     &lt;File name="E:\pqr\"/&gt;
  &lt;/File&gt;
  </code></pre>
  
  <p>Sorry if my question sound ambiguous </p>