And non validating parsers
The Java XML implementation does so whenever the DTD makes it possible.
The program is configured to take additional arguments when it is started, which tell it to implement no validation, DTD validation, XML Schema Definition (XSD) validation, or XSD validation against a specific schema source file.
option and providing the name of the schema source file to be used.
It is important to recognize that the only reason an exception is thrown when a file fails validation is as a result of the error-handling code shown in Setting up Error Handling. public void warning(SAXParse Exception spe) throws SAXException public void error(SAXParse Exception spe) throws SAXException public void fatal Error(SAXParse Exception spe) throws SAXException // ...
For now, think of these attributes as the "magic incantation" you use to validate a simple XML file that does not use them.
(Even a DTD qualifies as a "schema," although it is the only one that does not use XML syntax to describe schema constraints.) However, "XML Schema" presents us with a terminology challenge.
Although the phrase "XML Schema schema" would be precise, we will use the phrase "XML Schema definition" to avoid the appearance of redundancy.
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.
Remember that your application will not generate a validation exception unless you supply an error handler such as the one here.