The DocumentType Interface

The DocumentType interface represents a document's document type declaration. That is, it's the in-memory representation of the following construct:

<!DOCTYPE mml:math PUBLIC "-//W3C//DTD MathML 2.0//EN" 
 "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd" [
  <!ENTITY % MATHML.prefixed "INCLUDE">
  <!ENTITY % MATHML.prefix "mml">
]>

Each document type declaration has four parts, three of which are optional:

  1. The root element name (mml:math in the above example)

  2. The public ID (-//W3C//DTD MathML 2.0//EN in the above example)

  3. The system ID (http://www.w3.org/TR/MathML2/dtd/mathml2.dtd in the above example)

  4. The internal DTD subset (everything between the [ and the ])

It's important to note that the document type declaration is not ...

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.