sax :: LexicalHandler :: start_entity
The reporting of parameter entities (including
the external DTD subset) is optional, and SAX2 drivers that
report LexicalHandler
events may not implement it; you can use the
http://xml.org/sax/features/lexical-handler/parameter-entities
feature to query or control the reporting of parameter entities.
General entities are reported with their regular names,
parameter entities have %
prepended to their names, and
the external DTD subset has the pseudo-entity name [dtd]
.
When a SAX2 driver is providing these events, all other
events must be properly nested within start/end entity
events. There is no additional requirement that events from
DeclHandler
or org.xml.sax.DTDHandler DTDHandler
be properly ordered.
Note that skipped entities will be reported through the
skippedEntity
event, which is part of the ContentHandler
interface.
Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:
These will be silently expanded, with no indication of where the original entity boundaries were.
Note also that the boundaries of character references (which are not really entities anyway) are not reported.
All start_entity
and end_entity
events must be properly nested.
Parameter:
name
: name of the entity. If it is a parameter
entity, the name will begin with %
, and if it is the
external DTD subset, it will be [dtd]
.SEE: end_entity
SEE: sax::ext::DeclHandler.internal_entity_decl
SEE: sax::ext::DeclHandler.external_entity_decl
# Report the beginning of some internal and external XML entities.
#
# The reporting of parameter entities (including
# the external DTD subset) is optional, and SAX2 drivers that
# report `LexicalHandler` events may not implement it; you can use the
# `http://xml.org/sax/features/lexical-handler/parameter-entities`
# feature to query or control the reporting of parameter entities.
#
# General entities are reported with their regular names,
# parameter entities have `%` prepended to their names, and
# the external DTD subset has the pseudo-entity name `[dtd]`.
#
# When a SAX2 driver is providing these events, all other
# events must be properly nested within start/end entity
# events. There is no additional requirement that events from
# `DeclHandler` or `org.xml.sax.DTDHandler DTDHandler` be properly ordered.
#
# Note that skipped entities will be reported through the
# `skippedEntity` event, which is part of the `ContentHandler` interface.
#
# Because of the streaming event model that SAX uses, some
# entity boundaries cannot be reported under any
# circumstances:
#
# * general entities within attribute values
# * parameter entities within declarations
#
# These will be silently expanded, with no indication of where
# the original entity boundaries were.
#
# Note also that the boundaries of character references (which
# are not really entities anyway) are not reported.
#
# All `start_entity` and `end_entity` events must be properly nested.
#
# Parameter:
#
# * `name`: name of the entity. If it is a parameter
# entity, the name will begin with `%`, and if it is the
# external DTD subset, it will be `[dtd]`.
#
# SEE: `end_entity`
#
# SEE: `sax::ext::DeclHandler.internal_entity_decl`
#
# SEE: `sax::ext::DeclHandler.external_entity_decl`
fun start_entity(name: String) do end
lib/sax/ext/lexical_handler.nit:82,2--128,38
redef fun start_entity(name) do
log.push(["start_entity", name])
if lexical_handler != null then
lexical_handler.start_entity(name)
end
end
lib/saxophonit/testing.nit:495,2--500,4