elogger API
Overview Classes Cluster Class Index          Top Features

xml.parser.eiffel

Class XM_EIFFEL_PARSER_NAME


Direct ancestors

HASHABLE, XM_MARKUP_CONSTANTS, XM_UNICODE_STRUCTURE_FACTORY, KL_IMPORTED_STRING_ROUTINES

Creation

Features

Invariants

indexing

description

Parser name: optimised for namespaces but still allowing XML 1.0 names

todo

Review how to handle strict XML 1.0 with namespaces

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2002, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

class XM_EIFFEL_PARSER_NAME

inherit

HASHABLE

create

make_namespaces

-- Create a new empty name, that behaves with namespaces.

ensure

use_namespaces: use_namespaces

make_no_namespaces

--

ensure

not_use_namespaces: not use_namespaces

feature -- Access

first: STRING

-- First item (name or namespace)

hash_code: INTEGER

-- Hash code value
-- (From HASHABLE)

ensure

good_hash_value: Result >= 0

item (i: INTEGER): STRING

-- Item at position i.

require

i_large_enough: i >= 1
i_small_enough: i <= count

last: STRING

-- Last item

require

not_empty: not is_empty

ensure

definition: Result = item (count)

local_part: STRING

-- Local part
-- (including tail)

ns_prefix: STRING

-- Namespace prefix

ensure

no_namespaces_void: not use_namespaces implies Result = Void

feature -- Measurement

count: INTEGER

-- Number of items

feature -- Comparison

is_equal (other: like Current): BOOLEAN

-- Are Current and other considered equal?
-- (From ANY)

require

other_not_void: other /= Void

ensure

symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result

feature -- Status report

is_empty: BOOLEAN

-- Is name empty?

ensure

definition: Result = (count = 0)

is_name: BOOLEAN

-- Is Current a name?

is_named_namespace_declaration: BOOLEAN

-- Is current name an XML declaration for a named namespace?

is_namespace_declaration: BOOLEAN

-- Is current name an XML namespace declaration?

is_namespace_name: BOOLEAN

-- Is current name with a namespace?

is_simple_name: BOOLEAN

-- Is current name a simple name?

is_hashable: BOOLEAN

-- May current object be hashed?
-- (True if it is not its type's default.)
-- (From HASHABLE)

ensure

ok_if_not_default: Result implies (Current /= default)

use_namespaces: BOOLEAN

-- Is namespace parsing enabled?

feature -- Element change

can_force_last (a_string: STRING): BOOLEAN

-- Is it possible to add an element?

require

a_string_not_void: a_string /= Void

ensure

use_namespaces: not use_namespaces implies Result

force_last (a_string: STRING)

-- Add a_string at end.

require

a_string_not_void: a_string /= Void
allowed: can_force_last (a_string)

ensure

one_more: count = old count + 1
at_last: last = a_string

feature -- Removal

wipe_out

-- Remove all.

ensure

wiped_out: is_empty

feature -- Output

out: STRING

-- Colon-separated name
-- (From ANY)

feature {XM_EIFFEL_PARSER_NAME} -- Implementation

second: STRING

-- Second (name).

tail: DS_LIST[STRING]

-- Inefficient(?) tail, because "a:b:c:d" is valid XML 1.0 but
-- it is supposed to be rare in practice.

invariant

count_positive: count >= 0

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

Documentation generated by edoc