title: How to import linked XSD files in LXML
body: <p>I am trying to load a few linked XSD files as an LXML schema, but I suspect they are not loading correctly via <code>&lt;include&gt;</code> and <code>&lt;import&gt;</code>.</p>
  
  <p><strong>Does LXML require a manual import of each linked XSD file? If so, how does one go about it? If not, what is wrong with my approach below:</strong></p>
  
  <p>The exact files I am referring to can be found here: <a href="https://github.com/NordPool/Day-Ahead-Public" rel="nofollow noreferrer">https://github.com/NordPool/Day-Ahead-Public</a></p>
  
  <p>After extracting the files and running python in the directory, I do the following:</p>
  
  <pre><code>from lxml import etree
  xmlschema_doc = etree.parse('urn-ediel-org-neg-spotmarket-biddocument-1-0.xsd')
  etree.XMLSchema(xmlschema_doc)
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  XMLSchemaParseError                       Traceback (most recent call last)
  &lt;ipython-input-273-fd473f61b95f&gt; in &lt;module&gt;()
        1 xmlschema_doc = etree.parse(xsdRoot + 'urn-ediel-org-neg-spotmarket-biddocument-1-0.xsd')
  ----&gt; 2 etree.XMLSchema(xmlschema_doc)
  
  src/lxml/xmlschema.pxi in lxml.etree.XMLSchema.__init__ (src/lxml/lxml.etree.c:191759)()
  
  XMLSchemaParseError: simple type 'LocalRestrictedAllocationModeType', attribute 'base': The QName value '{urn:entsoe.eu:wgedi:codelists}LocalAllocationModeType' does not resolve to a(n) simple type definition., line 5
  </code></pre>
  
  <p>Some of the XSD files are supposed to be in <code>../../core/</code>, but fixing the reference in the files to use the same directory does not actually fix the problem.</p>
  
  <p>I have been assured that this validates in Altova XMLSpy.</p>