To validate an XML document with the Xerces2-j parser, the Xerces2-j classes need to be in the classpath.The Xerces2-j parser may be obtained from the Xerces2-j page.
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.
A character entity reference was found in an attribute that is not defined as part of the HTML specification being validated against.
This error may be caused by using an & character when no character reference was intended, in which case use '&' instead.
An XML document is said to be valid if its contents match with the elements, attributes and associated document type declaration(DTD), and if the document complies with the constraints expressed in it.
Apart from the built-in DTD support in parsers, lxml currently supports three schema languages: DTD, Relax NG and XML Schema.
The HTTP header information always takes precedence and this may cause the entire document to be full of errors."Most browsers can cope with badly formed comments but some robots may not.