Start Differentiate between validating and non validating xml parser

Differentiate between validating and non validating xml parser

If you want to validate an XML document against a DTD that is not referenced by the document itself, you can use the keyword argument to parse from a file.

This means that the XML file itself must either contain a DTD or must reference a DTD to make this work.

On the other hand, if you are writing an application that filters an XML data file and if you want to output an equally readable version of the file, then that white space would no longer be irrelevant: it would be essential.

To get those characters, you would add the This code simply generates a message to let you know that ignorable white space was seen. The SAX specification does not require that this method be invoked.

For validation to be possible, the XML document needs to be associated to a DTD or an XML schema. Up until this point, this lesson has concentrated on the non-validating parser.