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

xml.event

Class XM_XMLNS_GENERATOR_CONTEXT


Direct ancestors

KL_IMPORTED_STRING_ROUTINES, XM_MARKUP_CONSTANTS, UC_SHARED_STRING_EQUALITY_TESTER

Creation

Features

Invariants

indexing

description

Prefix map and context for xmlns declaration generation filter

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2004, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 19:45:03 $

revision

$Revision: 1.7 $

class

XM_XMLNS_GENERATOR_CONTEXT

create

make

-- Reset.

feature -- Default

is_same_as_default (a_namespace: STRING): BOOLEAN

-- Is namespace the same as the default one for the current element?

require
a_namespace_not_void: a_namespace /= Void
set_default (a_namespace: STRING)

-- Set default namespace URI.

require
a_namespace_not_void: a_namespace /= Void
ensure
set: STRING_.same_string (a_namespace, default_namespaces.item)

feature -- Setting

force (a_prefix: STRING; a_namespace: STRING)

-- Add namespace, prefix to context.

require
a_namespace_not_void: a_namespace /= Void
a_namespace_not_empty: not a_namespace.is_empty
a_prefix_not_void: a_prefix /= Void
a_prefix_not_empty: not a_prefix.is_empty
ensure
has: has (a_namespace)
item: item (a_namespace) = a_prefix

feature -- Status

element_has_prefix (a_prefix: STRING): BOOLEAN

-- Is this prefix used in the top element?

require
a_prefix_not_void: a_prefix /= Void
a_prefix_not_empty: not a_prefix.is_empty
element_prefix (a_prefix: STRING)

-- Declare prefix in use in top element.

require
a_prefix_not_void: a_prefix /= Void
a_prefix_not_empty: not a_prefix.is_empty
ensure
has: element_has_prefix (a_prefix)
has (a_namespace: STRING): BOOLEAN

-- Is namespace known to prefixes table?

require
a_namespace_not_void: a_namespace /= Void
a_namespace_not_empty: not a_namespace.is_empty
item (a_namespace: STRING): STRING

-- Find prefix for namespace

require
a_namespace_not_void: a_namespace /= Void
a_namespace_not_empty: not a_namespace.is_empty
ensure
result_not_empty: Result /= Void implies not Result.is_empty
new_element_cursor: DS_HASH_TABLE_CURSOR [STRING, STRING]

-- New element cursor.

ensure
result_not_void: Result /= Void

feature -- Elements

on_end_element

-- Pop context.

on_start_element

-- Push context.

invariant

prefixes_not_void: prefixes /= Void
element_prefixes_not_void: element_prefixes /= Void
default_namespaces_not_void: default_namespaces /= Void

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

end