SAX: Prolog (question 8 of 10)

David Megginson ak117 at freenet.carleton.ca
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);


CON
---

- 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
  needed.


PRO
---

- 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
  process.


MY RECOMMENDATION
-----------------

No.

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).


OTHER CONSIDERATIONS
--------------------

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

-- 
David Megginson                 ak117 at freenet.carleton.ca
Microstar Software Ltd.         dmeggins at microstar.com
      http://home.sprynet.com/sprynet/dmeggins/

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




More information about the Xml-dev mailing list