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

xml.xml_xpointer.xpointer_common

Class XM_XPOINTER_NAMESPACE_CONTEXT


Direct ancestors

XM_MARKUP_CONSTANTS, XM_UNICODE_CHARACTERS_1_0, KL_IMPORTED_STRING_ROUTINES, UC_SHARED_STRING_EQUALITY_TESTER

Creation

Features

Invariants

indexing

description

Objects that provide XML namespace bindings for XPointer

library

Gobo Eiffel XPointer Library

copyright

Copyright (c) 2005, Colin Adams and others

derivation

See notice at bottom of file

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2005/07/13 19:51:47 $

revision

$Revision: 1.2 $

class

XM_XPOINTER_NAMESPACE_CONTEXT

inherit

XM_MARKUP_CONSTANTS
XM_UNICODE_CHARACTERS_1_0
KL_IMPORTED_STRING_ROUTINES
UC_SHARED_STRING_EQUALITY_TESTER

create

make

-- Establish invariant.

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
is_namespace_proscribed (a_namespace_uri: STRING): BOOLEAN

-- Is it forbidden to create a binding onto a_namespace_uri?

require
namespace_uri_not_empty: a_namespace_uri /= Void and then a_namespace_uri.count > 0
is_prefix_declared (an_xml_prefix: STRING): BOOLEAN

-- Is there a binding for an_xml_prefix?

require
ncname: an_xml_prefix /= Void and then is_ncname (an_xml_prefix)
is_prefix_proscribed (an_xml_prefix: STRING): BOOLEAN

-- Is it forbidden to create a binding for an_xml_prefix?

require
ncname: an_xml_prefix /= Void and then is_ncname (an_xml_prefix)
namespace_cursor:DS_HASH_TABLE_CURSOR [STRING, STRING]

-- Cursor over declared namespace other than 'xml'

ensure
namespace_cursor_not_void: Result /= Void
namespace_uri (an_xml_prefix: STRING): STRING

-- Namespace URI for an_xml_prefix

require
ncname: an_xml_prefix /= Void and then is_ncname (an_xml_prefix)
prefix_declared: is_prefix_declared (an_xml_prefix)
ensure
namespace_uri_not_emoty: Result /= Void and then Result.count > 0
string_equality_tester: UC_STRING_EQUALITY_TESTER

-- String equality tester

-- (From UC_SHARED_STRING_EQUALITY_TESTER)

ensure
string_equality_tester_not_void: Result /= Void

feature -- Element change

bind (an_xml_prefix, a_namespace_uri: STRING)

-- Bind an_xml_prefix to a_namespace_uri.

require
ncname: an_xml_prefix /= Void and then is_ncname (an_xml_prefix)
namespace_uri_not_empty: a_namespace_uri /= Void and then a_namespace_uri.count > 0
prefix_not_declared: not is_prefix_declared (an_xml_prefix)
uri_not_proscribed: not is_namespace_proscribed (a_namespace_uri)
prefix_not_proscribed: not is_prefix_proscribed (an_xml_prefix)
ensure
prefix_declared: is_prefix_declared (an_xml_prefix)
correct_binding: STRING_.same_string (a_namespace_uri, namespace_uri (an_xml_prefix))

feature -- Character classes (appendix B)

is_base_char (a: INTEGER): BOOLEAN

-- Base char class.

-- (From XM_UNICODE_CHARACTERS_1_0)

is_combining_char (a: INTEGER): BOOLEAN

-- Combining char class.

-- (From XM_UNICODE_CHARACTERS_1_0)

is_digit (a: INTEGER): BOOLEAN

-- Digit class.

-- (From XM_UNICODE_CHARACTERS_1_0)

is_extender (a: INTEGER): BOOLEAN

-- Extender class.

-- (From XM_UNICODE_CHARACTERS_1_0)

is_ideographic (a: INTEGER): BOOLEAN

-- Ideographic class.

-- (From XM_UNICODE_CHARACTERS_1_0)

is_letter (a: INTEGER): BOOLEAN

-- Letter class.

-- (From XM_UNICODE_CHARACTERS_1_0)

feature -- Namespace characters

is_ncname_char (a: INTEGER): BOOLEAN

-- Is this a valid 'NCName' character?

-- (From XM_UNICODE_CHARACTERS)

ensure
definition: Result = (a /= (':').code and is_name_char (a))
is_ncname_first (a: INTEGER): BOOLEAN

-- Is this a valid first character of a 'NCName'?

-- (From XM_UNICODE_CHARACTERS)

ensure
definition: Result = (a /= (':').code and is_name_first (a))

feature -- Valid characters (section 2.2)

is_char (a: INTEGER): BOOLEAN

-- Valid content character?

-- (From XM_UNICODE_CHARACTERS)

is_name_char (a: INTEGER): BOOLEAN

-- Character for name?

-- (From XM_UNICODE_CHARACTERS)

is_name_first (a: INTEGER): BOOLEAN

-- Valid first character of name?

-- (From XM_UNICODE_CHARACTERS)

is_space (a: INTEGER): BOOLEAN

-- Space character?

-- (From XM_UNICODE_CHARACTERS)

feature -- Strings

is_name (a_name: STRING): BOOLEAN

-- Is a_name a valid XML 'Name'?

-- (From XM_UNICODE_CHARACTERS)

require
a_name_not_void: a_name /= Void
ensure
empty_not_name: a_name.is_empty implies not Result
is_ncname (a_name: STRING): BOOLEAN

-- Is a_name a valid XML Namespace 'NCName'?

-- (From XM_UNICODE_CHARACTERS)

require
a_name_not_void: a_name /= Void
ensure
empty_not_name: a_name.is_empty implies not Result
is_nmtoken (a_name: STRING): BOOLEAN

-- Is a_name a valid XML 'Nmtoken'?

-- (From XM_UNICODE_CHARACTERS)

require
a_name_not_void: a_name /= Void
is_qname (a_name: STRING): BOOLEAN

-- Is a_name a valid XML Namespace 'Qname'?
-- Qname := [NCName ':']? NCName

-- (From XM_UNICODE_CHARACTERS)

require
a_name_not_void: a_name /= Void
ensure
empty_not_name: a_name.is_empty implies not Result
is_string (a_string: STRING): BOOLEAN

-- Is a_string a string containing no invalid XML characters?

-- (From XM_UNICODE_CHARACTERS)

require
a_string_not_void: a_string /= Void
ensure
empty: (a_string.count = 0) implies Result

feature -- Constants

amp_char: CHARACTER
amp_entity: STRING
comment_end: STRING
cr_char: CHARACTER
emptytag_end: STRING
eq_s: STRING
etag_end: STRING
etag_start: STRING
gt_char: CHARACTER
gt_entity: STRING
lf_char: CHARACTER
lf_s: STRING
lt_char: CHARACTER
lt_entity: STRING
pi_end: STRING
pi_start: STRING
quot_char: CHARACTER
quot_entity: STRING
quot_s: STRING
space_char: CHARACTER
space_s: STRING
stag_end: STRING
stag_start: STRING
tab_char: CHARACTER
xml_base: STRING
xml_id: STRING
xml_lang: STRING
xml_prefix: STRING
xml_space: STRING
xmlns: STRING

invariant

bindings_not_void: bindings /= Void

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

end