class XML_NODE

All features

A node in an XML_TREE

Direct parents

non-conformant parents

ANY

Summary

creation features

exported features

Details

make (a_name: STRING)

require

  • a_name /= Void

name: STRING

The name of the node

attribute_name (index: INTEGER): STRING

The name of the i'th attribute

require

  • index.in_range(1, attributes_count)

attribute_value (index: INTEGER): STRING

The value of the i'th attribute

require

  • index.in_range(1, attributes_count)

attribute (a_attribute_name: STRING): STRING

The value of the attribute given by its name; Void if not set

attributes_count: INTEGER

The number of attributes

child (index: INTEGER): XML_NODE

The i'th child

require

  • index.in_range(1, children_count)

children_count: INTEGER

The number of children

parent: XML_NODE

The parent of the node, Void if it is the root

data: STRING

Data in the node, if there is some.

set_attribute (a_attribute_name: STRING, a_attribute_value: STRING)

require

  • a_attribute_name /= Void
  • a_attribute_value /= Void

ensure

  • attribute(a_attribute_name) = a_attribute_value

add_child (node: XML_NODE)

require

  • node /= Void
  • node.parent = Void
  • data = Void

ensure

  • node.parent = Current
  • child(children_count) = node

set_data (a_data: STRING)

require

  • a_data /= Void
  • children_count = 0

set_parent (a_parent: XML_NODE)

require

  • a_parent /= Void

ensure

  • parent = a_parent

attributes: DICTIONARY [V_, K_][STRINGSTRING]
children: COLLECTION[XML_NODE]
make (a_name: STRING)

require

  • a_name /= Void

Class invariant