Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

xml.tree

Class XM_NAMED_NODE


Direct ancestors

XM_ELEMENT_NODE, KL_IMPORTED_STRING_ROUTINES

Known direct descendants

XM_ELEMENT, XM_ATTRIBUTE

Features

Invariants

indexing

description

XML nodes that have a name

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2001, Andreas Leitner and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2003/12/18 22:04:24 $

revision

$Revision: 1.21 $

deferred class

XM_NAMED_NODE

inherit

XM_ELEMENT_NODE
KL_IMPORTED_STRING_ROUTINES

feature -- Access

string_: KL_STRING_ROUTINES

-- Routines that ought to be in class STRING

-- (From KL_IMPORTED_STRING_ROUTINES)

ensure
string_routines_not_void: Result /= Void
name: STRING

-- Name

namespace: XM_NAMESPACE

-- Namespace of the name of current node

ns_prefix: STRING

-- Namespace prefix used to declare the namespace of the
-- name of current node

require
has_ns: has_namespace
ensure
definition: Result = namespace.ns_prefix
ns_uri: STRING

-- URI of namespace.

require
has_ns: has_namespace
ensure
definition: Result = namespace.uri
parent: XM_COMPOSITE

-- Parent of current node;
-- Void if current node is root

-- (From XM_NODE)

feature -- Status report

has_namespace: BOOLEAN

-- Has the name of current node been defined with namespace?

ensure
definition: Result = (namespace /= Void)
has_prefix: BOOLEAN

-- Has a prefix been used to define the namespace?
-- (It could also be that the namespace used was the default namespace)

ensure
definition: Result = (ns_prefix /= Void and then ns_prefix.count > 0)
has_qualified_name (a_uri: STRING; a_name: STRING): BOOLEAN

-- Does this node match the qualified name?

require
a_uri_not_void: a_uri /= Void
a_name_not_void: a_name /= Void
ensure
definition: Result = (STRING_.same_string (a_uri, namespace.uri)and STRING_.same_string (a_name, name))
is_first: BOOLEAN

-- Is this node the first in its parent's child list,
-- or the root node?

-- (From XM_NODE)

ensure
definition: Result = (is_root_node or else (parent.first = Current))
is_last: BOOLEAN

-- Is this node the last in its parent's child list,
-- or the root node?

-- (From XM_NODE)

ensure
definition: Result = (is_root_node or else (parent.last = Current))
is_root_node: BOOLEAN

-- Is current node the root node?

-- (From XM_NODE)

ensure
definition: Result = (parent = Void)
level: INTEGER

-- Depth at which current node appears relative to its root
-- (The root node has the level 1.)

-- (From XM_NODE)

ensure
root_level: is_root_node implies (Result = 1)
parent_element: XM_ELEMENT

-- Parent element.

-- (From XM_NODE)

require
not_root_node: not is_root_node
not_root_element: not parent.is_root_node
ensure
result_not_void: Result /= Void
root_node: XM_DOCUMENT

-- Root node of current node

-- (From XM_NODE)

ensure
result_not_void: Result /= Void
same_name (other: XM_NAMED_NODE): BOOLEAN

-- Has current node same name and namespace as other?

require
other_not_void: other /= Void
ensure
definition: Result = (same_namespace (other) and same_name (other))
same_namespace (other: XM_NAMED_NODE): BOOLEAN

-- Has current node same namespace as other?

require
other_not_void: other /= Void
ensure
equal_namespaces: Result implies (((not has_namespace) and (not other.has_namespace))or else namespace.is_equal (other.namespace))

feature {XM_COMPOSITE} -- Element change

node_set_parent (a_parent: like parent)

-- Set parent to a_parent.

-- (From XM_NODE)

ensure
parent_set: parent = a_parent
set_name (a_name: like name)

-- Set name to a_name.

require
a_name_not_void: a_name /= Void
a_name_not_empty: a_name.count > 0
ensure
name_set: name = a_name
set_namespace (a_namespace: like namespace)

-- Set namespace to a_namespace.

require
a_namespace_not_void: a_namespace /= Void
ensure
namespace_set: namespace = a_namespace
set_parent (a_parent: like parent)

-- Set parent to a_parent.

-- (From XM_NODE)

require
a_parent_not_void: a_parent /= Void
not_root_node: not is_root_node
ensure
parent_set: parent = a_parent

feature -- Duplication

cloned_object: like Current

-- Clone of current object

-- (From KL_CLONABLE)

ensure
cloned_not_void: Result /= Void
same_type: ANY_.same_types (Result, Current)
is_equal: Result.is_equal (Current)

feature -- Processing

process (a_processor: XM_NODE_PROCESSOR)

-- Process current node with a_processor.

-- (From XM_NODE)

require
a_processor_not_void: a_processor /= Void

invariant

name_not_void: name /= Void
name_not_empty: name.count > 0
has_namespace: has_namespace


-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end