DTDHandler

SAX is mostly about the instance document, not the DTD or schema. However, given a validating parser, or at least an internal DTD subset, the DTD can affect the contents of the instance document in six ways:

  1. It can provide default values for attributes.

  2. It can assign types to attributes, which affects their normalized value.

  3. It can distinguish between ignorable and non-ignorable white space.

  4. It can declare general entities.

  5. It can declare unparsed entities.

  6. It can declare notations.

The first four are resolved silently. For example, when applying a default value for an attribute to an element, the parser simply adds that attribute to the Attributes object it passes to startElement(). It doesn't tell you that it's done it. It just does it. ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.