SAX: Prolog (question 8 of 10)

David Megginson ak117 at
Sun Jan 4 01:21:41 GMT 1998

[SAX is a proposal for a simple, event-based XML API, using
callbacks.  This is one in a series of ten design questions that we
need to answer to implement the API.]

Should SAX include events for the start and end of the prolog, and/or
for the DOCTYPE declaration?

  public void startProlog ();
  public void endProlog ();
  public void docType (String name, String systemID);


- these methods would make SAX slightly larger;

- these are pretty far out of scope -- the start and end of the prolog
  can easily be inferred, and a new DOCTYPE can be constructed if


- the DOM has a Doctype class;

- it would be nice to have a container of some sort around any PI's
  and entity start/ends found in the prolog, if we decide to include
  this information

- it can be useful to know what external DTD the document is using,
  possibly so that the DTD's URI can be passed off to a different



While this information would be marginally useful, it is really
designed for transformation applications, and SAX does not give enough
information for really useful transformations otherwise (James has
pointed out, for example, the lack of information about internal
entity boundaries).


If some implementations provide additional DTD-related functionality,
it would be nice to know when the prolog is finished and the DTD (if
present) is fully constructed.

All the best,


David Megginson                 ak117 at
Microstar Software Ltd.         dmeggins at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list