+
Point of view
All features
deferred class XML_CALLBACKS
Summary
Catch parsing events sent by the XML parser.
Caveat: expect those features to always receive the same UNICODE_STRING object with different values. You should take care of twinning the object if you want to keep it.
See also XML_PARSER
Direct parents
Insert list: ANY
Known children
Inherit list: XMLNS_PARSER, XML_REPOSITORY_IMPL, XML_TREE
Overview
Features
{XML_PARSER}
set_validator (a_validator: XML_VALIDATOR)
effective procedure
Sets a validator for this XML file.
The parser uses it when setting a DTD, but you may use it too to implement other validators (such as an XML Schema).
require ensure
validator: XML_VALIDATOR
writable attribute
The XML validator for this file (DTD, XML Schema...)
with_attribute (attribute_name: UNICODE_STRING, attribute_value: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32)
deferred procedure
Called by the parser to add an attribute of a node BEFORE calling open_node
require
  • not attribute_name.is_empty
  • attribute_value /= Void
open_node (node_name: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32)
deferred procedure
When the parser reads an opening node
require
  • not node_name.is_empty
ensure
close_node (node_name: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32)
deferred procedure
When the parser reads a closing node
require
open_close_node (node_name: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32)
deferred procedure
When the parser reads a node that opens and closes immediately (syntax "<node/>")
require
  • not node_name.is_empty
xml_header (line: INTEGER_32, column: INTEGER_32)
deferred procedure
Called by the parser if a "<?xml ... ?>"
header is read. Note that with_attribute may have been called first (usually with the version and encoding attributes)
processing_instruction (a_target: UNICODE_STRING, a_data: UNICODE_STRING)
deferred procedure
Called by the parser if a "<?...?>"
processing instruction is read.
entity (a_entity: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32): UNICODE_STRING
deferred function
Called by the parser when an &entity; is found.
Note that standard XML attributes (lt, gt, amp, apos and quot) are automatically handled and not given to this feature (they cannot be bypassed). Returns Void if the entity is not recognized.
open_entity_url (a_entity: UNICODE_STRING, a_url: URL)
deferred procedure
Called by the parser when the entity triggers the reading of another stream (i.e. a SYSTEM or PUBLIC entity)
require
  • a_url /= Void
close_entity_url (a_entity: UNICODE_STRING, a_url: URL)
deferred procedure
Called by the parser when the stream triggered by open_entity_url is disconnected
require
  • a_url /= Void
current_node: UNICODE_STRING
deferred function
The current node
data (a_data: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32)
deferred procedure
Called by the parser when the node contains raw data
require
  • not a_data.is_empty
parse_error (line: INTEGER_32, column: INTEGER_32, message: STRING)
deferred procedure
Called by the parser if there is an error
require
  • message /= Void
ensure
at_error: BOOLEAN
deferred function
True if there was at least an error