title: Reading XML with inline schema in python
body: <p>I have multiple XML files with Inline schema. I try to parse the xml data using python, but it does give me any result.</p>
  
  <p>I want to get the values of the elements</p>
  
  <p>ogrid_cde
  role </p>
  
  <p>from all ogridroles tags</p>
  
  <pre><code>&lt;root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
      &lt;xsd:schema targetNamespace="urn:schemas-microsoft-com:sql:SqlRowSet1" xmlns:schema="urn:schemas-microsoft-com:sql:SqlRowSet1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified"&gt;
          &lt;xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd"/&gt;
          &lt;xsd:element name="ogridroles"&gt;
              &lt;xsd:complexType&gt;
                  &lt;xsd:sequence&gt;
                      &lt;xsd:element name="ogrid_cde" type="sqltypes:int" nillable="1"/&gt;
                      &lt;xsd:element name="role" nillable="1"&gt;
                          &lt;xsd:simpleType&gt;
                              &lt;xsd:restriction base="sqltypes:char" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52"&gt;
                                  &lt;xsd:maxLength value="1"/&gt;
                              &lt;/xsd:restriction&gt;
                          &lt;/xsd:simpleType&gt;
                      &lt;/xsd:element&gt;
                  &lt;/xsd:sequence&gt;
              &lt;/xsd:complexType&gt;
          &lt;/xsd:element&gt;
      &lt;/xsd:schema&gt;
      &lt;ogridroles xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1"&gt;
          &lt;ogrid_cde&gt;28&lt;/ogrid_cde&gt;
          &lt;role&gt;T&lt;/role&gt;
      &lt;/ogridroles&gt;
      &lt;ogridroles xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1"&gt;
          &lt;ogrid_cde&gt;75&lt;/ogrid_cde&gt;
          &lt;role&gt;T&lt;/role&gt;
      &lt;/ogridroles&gt;
      &lt;ogridroles xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1"&gt;
          &lt;ogrid_cde&gt;93&lt;/ogrid_cde&gt;
          &lt;role&gt;O&lt;/role&gt;
      &lt;/ogridroles&gt;
      &lt;ogridroles xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1"&gt;
          &lt;ogrid_cde&gt;135&lt;/ogrid_cde&gt;
          &lt;role&gt;O&lt;/role&gt;
      &lt;/ogridroles&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Python Code</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  
  tree = ET.parse('ogridroles.xml')
  root = tree.getroot()
  
  for a in root.findall('{urn:schemas-microsoft-com:sql:SqlRowSet1}ogridroles'):
      print (a.attrib)
  </code></pre>