LexicalHandler
The LexicalHandler
is
used to receive information about syntactical events such as CDATA
section boundaries and comments in a
document. It is only supported using PyXML; the standard library does
not provide this. A simple base class for this handler is available as
the LexicalHandler
class in the
xml.sax.saxlib
module. The LexicalHandler
can be set using the setProperty
method on the parser object,
using the property constant property_lexical_handler
from the xml.sax.handler
module.
comment(
text
)
This method is called when the parser finds a
comment in the document. The body of the comment, between the
two occurrences of --
, is
passed as the text
parameter.
startDTD( )
This method is called before the parser starts reading any DTD information, regardless of whether that information is in the internal or external subset. This method is called at most once.
endDTD( )
The parser calls this method after all DTD information is read; it is called at most once.
startEntity(
name
)
This method is called when the parser begins parsing the entity associated
with the name name
in the DTD. The
only way to know about the names defined in the DTD is to
provide a DeclHandler
and
implement the externalEntityDecl
and internalEntityDecl
methods.
endEntity(
name
)
The parser calls this method when it is finished
parsing the entity identified by
name
. See startEntity
for information about
using entity names.
startCDATA( )
endCDATA( )