#NEWLINE# def test_xmlschema_parse( self ) : #NEWLINE# #INDENT# schema = self . parse ( '\n<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n  <xsd:element name="a" type="AType"/>\n  <xsd:complexType name="AType">\n    <xsd:sequence>\n      <xsd:element name="b" type="xsd:string" />\n    </xsd:sequence>\n  </xsd:complexType>\n</xsd:schema>\n' ) #NEWLINE# schema = etree . XMLSchema ( schema ) #NEWLINE# parser = etree . XMLParser ( schema = schema ) #NEWLINE# tree_valid = self . parse ( '<a><b></b></a>' , parser = parser ) #NEWLINE# self . assertEqual ( 'a' , tree_valid . getroot ( ) . tag ) #NEWLINE# self . assertRaises ( etree . XMLSyntaxError , schema . parse , '<a><c></c></a>' , parser = parser )