com.sun.xml.parser
Interface LexicalEventListener

All Known Implementing Classes:
XmlDocumentBuilder

public abstract interface LexicalEventListener
extends DocumentHandler

Provides notification of information which DOM permits to be exposed. This consists of lexical information (comments; and alternative representations and modularizations of content) which is generally intended to be relevant only to document authors.

Even when combined with other information provided by SAX parsers, this information is not sufficient to physically recreate the source document. Certain classes of white space are not presented (e.g. whitespace separating attributes in start tags, and outside of the document element), and line ending characters are normalized (per the XML specification) to a single newline.

See Also:
DtdEventListener

Method Summary
 void comment(java.lang.String text)
          Receive notification that a comment has been read.
 void endCDATA()
          Receive notification that the CDATA section finished.
 void endParsedEntity(java.lang.String name, boolean included)
          Receive notification that the named entity inclusion into document content is completed.
 void startCDATA()
          Receive notification that a CDATA section is beginning.
 void startParsedEntity(java.lang.String name)
          Receive notification that the named entity is being included in document content (not element attributes).
 
Methods inherited from interface org.xml.sax.DocumentHandler
characters, endDocument, endElement, ignorableWhitespace, processingInstruction, setDocumentLocator, startDocument, startElement
 

Method Detail

startParsedEntity

public void startParsedEntity(java.lang.String name)
                       throws SAXException
Receive notification that the named entity is being included in document content (not element attributes). The name identifies either an internal or external entity, as reported to the DtdEventListener. Note that the XML specification defines two types of parsed entities: general entities, and parameter entities. This event refers only to general parsed entities.
Parameters:
name - the name of the entity now being included
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
DtdEventListener, endParsedEntity(java.lang.String, boolean)

endParsedEntity

public void endParsedEntity(java.lang.String name,
                            boolean included)
                     throws SAXException
Receive notification that the named entity inclusion into document content is completed. The name identifies either an internal or external entity, as reported to the DtdEventListener.

The XML specification requires nonvalidating XML processors to tell applications when they recognize, but do not include, external parsed entities. (Section 4.4.3 defines entity inclusion in this manner.) That notification is provided through this method. Applications might request, through EntityResolver, that an entity not be included ... such a mechanism remains TBS.

Parameters:
name - the name of the entity whose inclusion is completed.
included - true iff the entity was included; always true for validating parsers.
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
startParsedEntity(java.lang.String)

startCDATA

public void startCDATA()
                throws SAXException
Receive notification that a CDATA section is beginning. Data in a CDATA section is is reported through the appropriate event, either characters() or ignorableWhitespace.
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
endCDATA(), DocumentHandler.characters(char[], int, int), DocumentHandler.ignorableWhitespace(char[], int, int)

endCDATA

public void endCDATA()
              throws SAXException
Receive notification that the CDATA section finished.
Throws:
SAXException - any SAX exception, possibly wrapping another exception
See Also:
startCDATA()

comment

public void comment(java.lang.String text)
             throws SAXException
Receive notification that a comment has been read.

Note that processing instructions are the mechanism designed to hold information for consumption by applications, not comments. XML systems may rely on applications being able to access information found in processing instructions; this is not true of comments, which are typically discarded.

Parameters:
text - the text within the comment delimiters.
Throws:
SAXException - any SAX exception, possibly wrapping another exception


Submit Feedback to xml-feedback@java.sun.com
Copyright © 1998-1999 Sun Microsystems, Inc. All Rights Reserved.

Sun Microsystems, Inc.
901 San Antonio Road
Palo Alto, California, 94303, U.S.A.