+
Point of view
All features
class XMLNS_TREE
Summary
DOM-like namespace-aware representation of an XML document
See also XMLNS_PARSER, XML_TREE
Direct parents
Inherit list: XMLNS_CALLBACKS
Overview
Creation features
{ANY}
Features
{ANY}
{}
{XMLNS_PARSER}
{}
Memory management
{}
{XMLNS_PARSER}
writable attribute
{ANY}
The root of the tree
attribute_at (a_attribute_name: UNICODE_STRING): UNICODE_STRING
effective function
{ANY}
Usually to recover the "version" or "encoding" attributes
set_processing_instruction (target: UNICODE_STRING, processor: PROCEDURE[TUPLE 1[UNICODE_STRING]])
effective procedure
{ANY}
require
  • target /= Void
  • processor /= Void
no_namespace_attributes: HASHED_DICTIONARY[UNICODE_STRING, UNICODE_STRING]
writable attribute
{}
writable attribute
{}
writable attribute
{}
once function
{}
with_attribute (attribute_namespace: UNICODE_STRING, attribute_name: UNICODE_STRING, attribute_value: UNICODE_STRING, line: INTEGER_32, column: 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_namespace: UNICODE_STRING, node_name: UNICODE_STRING, line: INTEGER_32, column: 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)
  • not at_error implies current_namespace = node_namespace or else node_namespace /= Void and then current_namespace /= Void and then current_namespace.is_equal(node_namespace)
close_node (node_namespace: UNICODE_STRING, node_name: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32)
effective procedure
When the parser reads a closing node
require
  • not node_name.is_empty
  • current_node.is_equal(node_name)
  • node_namespace = Void implies current_namespace = Void
  • node_namespace /= Void implies current_namespace.is_equal(node_namespace)
open_close_node (node_namespace: UNICODE_STRING, node_name: UNICODE_STRING, line: INTEGER_32, column: 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 (line: INTEGER_32, column: 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.
current_node: UNICODE_STRING
effective function
The current node
current_namespace: UNICODE_STRING
effective function
The current namespace
entity (a_entity: UNICODE_STRING, line: INTEGER_32, column: 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.
data (a_data: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32)
effective 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)
effective procedure
Called by the parser if there is an error
require
  • message /= Void
ensure
  • at_error
at_error: BOOLEAN
writable attribute
True if there was at least an error
writable attribute
{}
make (url: URL)
effective procedure
{}
read the xml tree at the given url
require
  • url.is_connected implies url.read
with_error_handler (url: URL, a_error_handler: PROCEDURE[TUPLE 3[INTEGER_32, INTEGER_32, STRING]])
effective procedure
{}
new_node (node_namespace: UNICODE_STRING, node_name: UNICODE_STRING, line: INTEGER_32, column: INTEGER_32): XMLNS_COMPOSITE_NODE
effective function
{}
parser: XMLNS_PARSER
once function
{}
effective function
{}
ensure
  • Result.is_empty
old_attributes (a_attributes: HASHED_DICTIONARY[UNICODE_STRING, UNICODE_STRING])
effective procedure
{}
effective function
{}
ensure
clear_attributes
effective procedure
{}
ensure
set_validator (a_validator: XMLNS_VALIDATOR)
effective procedure
Sets a validator for this XML file.
require ensure
validator: XMLNS_VALIDATOR
writable attribute
The XML validator for this file (usually an XML Schema)