OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   SAX2: LexicalHandler

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <david@megginson.com>
  • To: XMLDev list <xml-dev@ic.ac.uk>
  • Date: Wed, 22 Dec 1999 09:30:33 -0500 (EST)

Just a quick review -- here's the LexicalHandler from SAX2 alpha,
modified so that the callbacks throw IOException rather than
SAXException:

  public interface LexicalHandler
  {
    public void startDTD (String name, String publicId, String systemId)
      throws IOException;
    public void endDTD () throws IOException;

    public void startEntity (String name) throws IOException;
    public void endEntity (String name) throws IOException;

    public void startCDATA () throws IOException;
    public void endCDATA () throws IOException;

    public void comment (char ch[], int start, int length)
      throws IOException;
  }

Notes:

1. start/endDTD refer to the start and end of the DOCTYPE declaration, 
   not to the start and end of the external DTD subset.  The
   parameters are those given in the DOCTYPE declaration (if present).

2. The start/endEntity callbacks provide the entity name, prefixed
   with '%' if it is a parameter entity, or the special names
   [document] for the document entity or [dtd] for the external DTD
   subset.

During the original design a few months back, we decided not to
provide the public and system identifiers in start/endEntity, because
that information would be available through the DeclHandler (which
I'll include in a following message).  Since both the LexicalHandler
and the DeclHandler are optional, however, I wonder if a little
redundancy would make sense:

    public void startEntity (String name, String publicId,
                             String systemId) throws IOException;
    public void endEntity (String name) throws IOException;

That way, if the parser supports the LexicalHandler but not the
DeclHandler, the public and system identifiers for entities will still 
be available.

Comments?


All the best,


David

-- 
David Megginson                 david@megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS