Gamma |
|
Collection of Guile Modules |
Sergey Poznyakoff |
Gamma (split by section): | ? |
This section describes all available element handlers. For clarity, each handler is described in its own subsection. For each handler, we indicate a keyword that is used when registering this handler and the handler prototype.
To register handlers, use xml-make-parser
or
xml-set-handler
functions. See section Creating XML Parsers, for a
detailed discussion of these functions.
Sets handler for start (and empty) tags.
The handler must be defined as follows:
Arguments:
Element name.
A list of element attributes. Each attribute is represented by a cons (‘car’ holds attribute name, ‘cdr’ holds its value).
Sets handler for end (and empty) tags. An empty tag generates a call to both start and end handlers (in that order).
The handler must be defined as follows:
Arguments:
Element name
Sets a text handler. A single block of contiguous text free of markup may result in a sequence of calls to this handler. So, if you are searching for a pattern in the text, it may be split across calls to this handler.
The handler itself is defined as:
Arguments:
The text.
Set a handler for processing instructions.
Arguments are:
First word in the processing instruction.
The rest of the characters in the processing instruction, after target and whitespace following it.
Sets a handler for comments.
The text inside the comment delimiters.
Sets a handler that gets called at the beginning of a CDATA section.
The handler is defined as follows:
Sets a handler that gets called at the end of a CDATA section.
The handler is defined as:
Sets a handler for any characters in the document which wouldn't otherwise be handled. This includes both data for which no handlers can be set (like some kinds of DTD declarations) and data which could be reported but which currently has no handler set.
A string containing all non-handled characters, which are passed exactly as they were present in the input XML document except that they will be encoded in UTF-8 or UTF-16. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the default handler: for example, a comment might be split between multiple calls. Setting the ‘default’ handler has the side effect of turning off expansion of references to internally defined general entities. Such references are passed to the default handler verbatim.
This sets a default handler as above, but does not inhibit the expansion of internal entity references. Any entity references are not passed to the handler.
The handler prototype is the same as in default-handler.
Set a skipped entity handler, i.e. a handler which is called if:
Arguments are:
Name of the entity.
This argument is #t
if the entity is a parameter, and #f
otherwise.
Set a handler to be called when a namespace is declared.
Arguments:
Namespace prefix.
Namespace URI.
Set a handler to be called when leaving the scope of a namespace declaration. This will be called, for each namespace declaration, after the handler for the end tag of the element in which the namespace was declared.
The handler prototype is:
Sets a handler that is called for XML declarations and also for text declarations discovered in external entities.
Arguments:
Version specification (string), or #f
, for text declarations.
Encoding. May be #f
.
‘Unspecified’, if there was no standalone parameter in the
declaration. Otherwise, #t
or #f
depending on whether
it was given as ‘yes’ or ‘no’.
Set a handler that is called at the start of a ‘DOCTYPE’ declaration, before any external or internal subset is parsed.
Arguments:
Declaration name.
System ID. May be #f
.
Public ID. May be #f
.
#t
if the ‘DOCTYPE’ declaration has an internal subset,
#f
otherwise.
Set a handler that is called at the end of a ‘DOCTYPE’ declaration, after parsing any external subset.
The handler takes no arguments:
Sets a handler for ‘attlist’ declarations in the DTD. This handler is called for each attribute, which means, in particular, that a single attlist declaration with multiple attributes causes multiple calls to this handler.
The handler prototype is:
Argument:
Name of the element for which the attribute is being declared.
Attribute name.
Default value, if el-name is a ‘#FIXED’ attribute,
#t
, if it is a ‘#REQUIRED’ attribute, and #f
, if it
is a ‘#IMPLIED’ attribute.
Sets a handler that will be called for all entity declarations.
Arguments:
Entity name.
For parameter entities, #t
. Otherwise, #f
.
For internal entities, entity value. Otherwise, #f
.
Base.
System ID. For internal entities – #f
.
Public ID. For internal entities – #f
.
Notation name, for unparsed entity declarations. Otherwise,
#f
. Unparsed are entity declarations that have a notation
(‘NDATA’) field, such as:
<!ENTITY logo SYSTEM "images/logo.gif" NDATA gif> |
Sets a handler that receives notation declarations.
Handler prototype is:
Sets a handler that is called if the document is not standalone, i.e. when there is an external subset or a reference to a parameter entity, but does not have ‘standalone’ set to "yes" in an XML declaration.
The handler takes no arguments:
Gamma (split by section): | ? |
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.