title: lxml parse xsd file without Schema URL
body: <p>I am using lxml to parse an xsd file and am looking for an easy way to remove the URL namespace attached to each element name. Here's the xsd file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;xs:element name="rootelement"&gt;
      &lt;xs:complexType&gt;
        &lt;xs:choice maxOccurs="unbounded"&gt;
          &lt;xs:element minOccurs="1" maxOccurs="1" name="element1"&gt;
            &lt;xs:complexType&gt;
              &lt;xs:all&gt;
                &lt;xs:element name="subelement1" type="xs:string" /&gt;
                &lt;xs:element name="subelement2" type="xs:integer" /&gt;
                &lt;xs:element name="subelement3" type="xs:dateTime" /&gt;
              &lt;/xs:all&gt;
              &lt;xs:attribute name="id" type="xs:integer" use="required" /&gt;
            &lt;/xs:complexType&gt;
          &lt;/xs:element&gt;
         &lt;/xs:choice&gt;
        &lt;xs:attribute fixed="2.0" name="version" type="xs:decimal" use="required" /&gt;
      &lt;/xs:complexType&gt;
    &lt;/xs:element&gt;
  &lt;/xs:schema&gt;
  </code></pre>
  
  <p>and using this code:</p>
  
  <pre><code>from lxml import etree
  
  parser = etree.XMLParser()
  data = etree.parse(open("testschema.xsd"),parser)
  root = data.getroot()
  rootelement = root.getchildren()[0]
  rootelementattribute = rootelement.getchildren()[0].getchildren()[1]
  print "root element tags"
  print rootelement[0].tag
  print rootelementattribute.tag
  elements = rootelement.getchildren()[0].getchildren()[0].getchildren()
  elements_attribute = elements[0].getchildren()[0].getchildren()[1]
  print "element tags"
  print elements[0].tag
  print elements_attribute.tag
  subelements = elements[0].getchildren()[0].getchildren()[0].getchildren()
  print "subelements"
  print subelements
  </code></pre>
  
  <p>I get the following output</p>
  
  <pre><code>root element tags
  {http://www.w3.org/2001/XMLSchema}complexType
  {http://www.w3.org/2001/XMLSchema}attribute
  element tags
  {http://www.w3.org/2001/XMLSchema}element
  {http://www.w3.org/2001/XMLSchema}attribute
  subelements
  [&lt;Element {http://www.w3.org/2001/XMLSchema}element at 0x7f2998fb16e0&gt;, &lt;Element {http://www.w3.org/2001/XMLSchema}element at 0x7f2998fb1780&gt;, &lt;Element {http://www.w3.org/2001/XMLSchema}element at 0x7f2998fb17d0&gt;]
  </code></pre>
  
  <p>I don't want "{http://www.w3.org/2001/XMLSchema}" to appear at all when I pull the tag data (altering the xsd file is not an option). The reason I need the xsd tag info is that I am using this to validate column names from a series of flat files. On the "element" level there are multiple elements that I'm pulling, as well as subelements, which I am using a dictionary to validate columns. Also, any suggestions on improving the code above would be greatly, such as a way to use fewer "getchildren" calls, or just make it more organized.</p>