title: lxml/MathML XML Schema - How do I fix "content model is not determinist." error?
body: <p>I'm following the <a href="http://lxml.de/validation.html#xmlschema" rel="nofollow">lxml validation documentation</a> to build a class that validates a given XML string against the Math ML 3.0 schema. Here's the class:</p>
  
  <pre><code>class XMLSchema(object):
  
      def __init__(self, path_to_xsd_file):
          with open(path_to_xsd_file) as f:
              xmlschema_doc = etree.parse(f)
          self.xmlschema = etree.XMLSchema(xmlschema_doc)
  
      def validate(self, well_formed_xml_string):
          """Validates a well-formed XML string against an XML schema.
  
          Returns True if xml_string is valid, False if not.
  
          """
          xml = etree.parse(StringIO(well_formed_xml_string))
          return self.xmlschema.validate(xml)
  </code></pre>
  
  <p>Instantiating it produces the following:</p>
  
  <pre><code>&gt;&gt;&gt; x = XMLSchema('mathml3.xsd')
  Traceback (most recent call last):
  ...
  lxml.etree.XMLSchemaParseError: complex type 
  'annotation-xml.model': The content model is not determinist., line 42
  </code></pre>
  
  <p>How do I fix this?</p>