Define validating parser
This work is licensed under the MIT License (see the LICENSE file).Apart from the built-in DTD support in parsers, lxml currently supports three schema languages: DTD, Relax NG and XML Schema.This means that the XML file itself must either contain a DTD or must reference a DTD to make this work.
All you have to do is use a parser that has DTD validation enabled: option, which loads the DTD and weaves attribute default values into the document.
When an XML document is then fed to the parser, the handler functions are called for the character data and markup in the XML document.
This module uses the , if specified, must be a string naming the encoding used by the XML data.
This can improve performance substantially since Expat normally breaks character data into chunks at every line ending.
This attribute is false by default, and may be changed at any time.