+
Point of view
All features
class XMLNS_PARSER
Summary
A namespace-aware XML parser
Direct parents
Inherit list: XML_CALLBACKS
Insert list: XML_NAMESPACES
Overview
Creation features
{ANY}
  • connect_to (a_url: URL)
    Connect to the given XML document
  • make
    Create a not connected parser
Features
{ANY}
{}
{XML_NAMESPACES}
{XML_PARSER}
{}
Memory management
{}
{XML_PARSER}
{}
{ANY}
parse (a_callbacks: XMLNS_CALLBACKS)
effective procedure
{ANY}
Parse an XML documents by sending parsing events to the given callbacks
require
connect_to (a_url: URL)
effective procedure
{ANY}
Connect to the given XML document
require
disconnect
effective procedure
{ANY}
require ensure
is_connected: BOOLEAN
effective function
{ANY}
line: INTEGER_32
effective function
{ANY}
column: INTEGER_32
effective function
{ANY}
make
effective procedure
{}
Create a not connected parser
parser: XML_PARSER
writable attribute
{}
callbacks: XMLNS_CALLBACKS
writable attribute
{}
set_validator (a_validator: XMLNS_VALIDATOR)
effective procedure
validator: XMLNS_VALIDATOR
effective function
with_attribute (attribute_name: UNICODE_STRING, attribute_value: UNICODE_STRING, l: INTEGER_32, c: INTEGER_32)
effective 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, l: INTEGER_32, c: INTEGER_32)
effective procedure
When the parser reads an opening node
require
  • not node_name.is_empty
ensure
  • not at_error implies current_node.is_equal(node_name)
close_node (node_name: UNICODE_STRING, l: INTEGER_32, c: INTEGER_32)
effective procedure
When the parser reads a closing node
require
  • not node_name.is_empty
  • current_node.is_equal(node_name)
open_close_node (node_name: UNICODE_STRING, l: INTEGER_32, c: INTEGER_32)
effective procedure
When the parser reads a node that opens and closes immediately (syntax "<node/>")
require
  • not node_name.is_empty
xml_header (l: INTEGER_32, c: INTEGER_32)
effective 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)
effective procedure
Called by the parser if a "<?...?>"
processing instruction is read.
entity (a_entity: UNICODE_STRING, l: INTEGER_32, c: INTEGER_32): UNICODE_STRING
effective 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.
current_node: UNICODE_STRING
effective function
The current node
data (a_data: UNICODE_STRING, l: INTEGER_32, c: INTEGER_32)
effective procedure
Called by the parser when the node contains raw data
require
  • not a_data.is_empty
parse_error (l: INTEGER_32, c: INTEGER_32, message: STRING)
effective procedure
Called by the parser if there is an error
require
  • message /= Void
ensure
  • at_error
at_error: BOOLEAN
effective function
True if there was at least an error
namespace: UNICODE_STRING
writable attribute
{}
writable attribute
{}
split_namespace (a_name: UNICODE_STRING, l: INTEGER_32, c: INTEGER_32)
effective procedure
{}
Sets namespace and name according to the given name, splitting at the first colon (':').
If there is no colon, namespace is Void and name contains the full given name. Otherwise namespace contains the URI of the namespace and name contains the part of the given name after the first colon.
writable attribute
{}
The known namespaces
xml_attribute (attribute_name: UNICODE_STRING, attribute_value: UNICODE_STRING, l: INTEGER_32, c: INTEGER_32)
effective procedure
{}
require
  • attribute_name /= Void
find_namespace (a_namespace_ref: UNICODE_STRING): UNICODE_STRING
effective function
{}
find_namespace_ref (a_namespace: UNICODE_STRING): UNICODE_STRING
effective function
{}
attributes_for_new_node: BOOLEAN
writable attribute
{}
effective function
{}
ensure
  • Result.is_empty
old_namespaces (a_namespaces: BIJECTIVE_DICTIONARY[UNICODE_STRING, UNICODE_STRING])
effective procedure
{}
once function
{}
string_twin (unicode: UNICODE_STRING): UNICODE_STRING
effective function
{}
require
  • unicode /= Void
ensure
  • Result.is_equal(unicode)
string_recycle (unicode: UNICODE_STRING)
effective procedure
{}
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
namespace_actions: HASHED_DICTIONARY[PROCEDURE[TUPLE 2[XMLNS_PARSER, UNICODE_STRING]], UNICODE_STRING]
once function
{}
register_namespace_action (a_namespace: UNICODE_STRING, a_action: PROCEDURE[TUPLE 2[XMLNS_PARSER, UNICODE_STRING]])
effective procedure
{ANY}