Receiving Skipped Entities

Validating parsers resolve all general entity references that occur in both element content and attribute values. However, nonvalidating parsers are allowed not to read the external DTD subset. Consider the simple XHTML document in Example 6.14.

Example 6.14. An XML Document Containing a Potentially Skipped Entity Reference
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
              "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <body>
     <h1>My resum&eacute;</h1>
  </body>
</html>

If a parser does not read the DTD, then it has no way of knowing what the entity reference &eacute; stands for, or indeed whether that entity reference is even properly defined. However, such a ...

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.