Oh well...) So what happens when you run the parser on your current version of the slide presentation, with the DTD specified? Element "item" does not allow "em" -- (#PCDATA|item) sax. That code is reproduced below: In general, a SAX parsing error is a validation error, although we have seen that it can also be generated if the file specifies a version of XML that the parser is not prepared to handle.
SAXParse Exception: Element "item" does not allow "em" -- (#PCDATA|item) at xml.parser. The thing to remember is that your application will not generate a validation exception unless you supply an error handler like the one above.
For a more detailed comparison, see When to Use SAX.
Setting up a program to use SAX requires a bit more work than setting up to use the Document Object Model (DOM).
Xerces has full support for the W3C Document Object Model (DOM) Level 1 and the Simple API for XML (SAX) 1.0 and 2.0; however it currently has only limited support for XML Schemas, DOM Level 2 (version 1). You can use Xalan, also available from Apache's Web site, for XSLT processing. Xerces uses the SAX2 method get Feature() and set Feature() to query and set various parser features.Two things to understand about the validating parser at the outset are: The factory name you specify must be a fully qualified class name (all package prefixes included).For more information, see the documentation for the SAXParser Factory class.Note - In a nutshell, SAX is oriented towards state independent processing, where the handling of an element does not depend on the elements that came before.St AX, on the other hand, is oriented towards state dependent processing.