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

xml.parser.interface

Class XM_NON_INCREMENTAL_PARSER


Direct ancestors

XM_PARSER

Known direct descendants

XM_EIFFEL_PARSER_SKELETON

Features

Invariants

indexing

description

Abstract definition of a non-incremental XML parser

library

Gobo Eiffel XML Library

copyright

Copyright (c) 2002, Eric Bezault and others

license

Eiffel Forum License v2 (see forum.txt)

date

$Date: 2003/02/07 13:12:07 $

revision

$Revision: 1.3 $

deferred class

XM_NON_INCREMENTAL_PARSER

inherit

XM_PARSER

feature -- Access

position: XM_POSITION

-- Current position in the XML entity being parsed.

-- (From XM_PARSER)

ensure
position_not_void: Result /= Void
positions: DS_LIST [XM_POSITION]

-- Current position from the XML entity being parsed, and
-- the position where it was included.

-- (From XM_PARSER)

ensure
positions_not_void: Result /= Void
source: XM_SOURCE

-- Source of the XML document being parsed.

-- (From XM_PARSER)

ensure
source_not_void: Result /= Void

feature -- Status report

is_incremental: BOOLEAN

-- Non incremental parser

-- (From XM_PARSER)

is_string_mode_ascii: BOOLEAN

-- Is string mode set to ascii only?
-- This means that all strings issued by this source
-- will be of dynamic type STRING.

-- (From XM_STRING_MODE)

is_string_mode_latin1: BOOLEAN

-- Is string mode set to latin-1 only?
-- This means that all strings issued by this source
-- will be of dynamic type STRING.

-- (From XM_STRING_MODE)

is_string_mode_mixed: BOOLEAN

-- Is string mode set to polymorphic strings?
-- This means that strings issued by this source will
-- be of dynamic type STRING for ascii, and dynamic
-- type UC_STRING or descendant when characters >127
-- are present in that string.

-- (From XM_STRING_MODE)

is_string_mode_unicode: BOOLEAN

-- Is string mode set to UC_STRING only?
-- This means that all strings issued by this source
-- will be of a dynamic type UC_STRING or descendant.

-- (From XM_STRING_MODE)

same_string_mode (other: XM_STRING_MODE): BOOLEAN

-- Is other with the same string mode?

-- (From XM_STRING_MODE)

require
other_not_void: other /= Void

feature -- Status setting

set_string_mode_ascii

-- Set all strings issued by this source to be ascii
-- (all characters <= 127) and be of dynamic type STRING.
-- The source will be in an error state if it has
-- characters that do not fit in a STRING.

-- (From XM_STRING_MODE)

ensure
string_mode_set: is_string_mode_ascii
set_string_mode_latin1

-- Set all strings issued by this source to be latin-1
-- (all characters <= 255) and be of dynamic type STRING.
-- The source will be in an error state if it has
-- characters that do not fit in a STRING.

-- (From XM_STRING_MODE)

ensure
string_mode_set: is_string_mode_latin1
set_string_mode_mixed

-- Set all strings issued by this source to be either of
-- type UC_STRING or descendant if they contain characters
-- >127 or of dynamic type STRING otherwise.
-- The client receiving these strings will have to
-- be careful about polymorphically unsafe features
-- of STRING, like append_string.

-- (From XM_STRING_MODE)

ensure
string_mode_set: is_string_mode_mixed
set_string_mode_unicode

-- Set all strings issued by this source to be of
-- dynamic type UC_STRING or descendant.

-- (From XM_STRING_MODE)

ensure
string_mode_set: is_string_mode_unicode

feature -- Incremental parsing

finish_incremental

-- Precondition always false.

-- (From XM_PARSER)

require
is_incremental: is_incremental
ensure then
not_possible: False
parse_incremental_from_stream (a_stream: KI_CHARACTER_INPUT_STREAM)

-- Precondition always false.

-- (From XM_PARSER)

require
is_incremental: is_incremental
a_stream_not_void: a_stream /= Void
is_open_read: a_stream.is_open_read
ensure then
not_possible: False
parse_incremental_from_string (data: STRING)

-- Precondition always false.

-- (From XM_PARSER)

require
is_incremental: is_incremental
a_data_not_void: a_data /= Void
ensure then
not_possible: False
set_end_of_document

-- Old name for finish_incremental.

-- (From XM_PARSER)

obsolete

Use finish_incremental instead.

feature {XM_PARSER_STOP_ON_ERROR_FILTER} -- Error reporting

force_unreported_error (an_error: STRING)

-- Force error but do not report it to event listeners.

-- (From XM_PARSER)

require
an_error_not_void: an_error /= Void
is_correct: BOOLEAN

-- Has no error been detected?

-- (From XM_PARSER)

last_error: INTEGER

-- Code of last error
-- (See XM_ERROR_CODES.)

-- (From XM_PARSER)

last_error_description: STRING

-- Textual description of last error

-- (From XM_PARSER)

require
has_error: not is_correct
last_error_extended_description: STRING

-- Verbose textual description of last error

-- (From XM_PARSER)

require
has_error: not is_correct
ensure
description_not_void: Result /= Void
new_stop_on_error_filter: XM_PARSER_STOP_ON_ERROR_FILTER

-- Create a stop on error filter that not only
-- stops forwarding events but also stops the
-- parser if the error comes from the preceding
-- event filters.
-- The result must be used only for processing events
-- coming from the current parser.

-- (From XM_PARSER)

ensure
result_not_void: Result /= Void
new_stop_on_error_filter_next (a_next: XM_CALLBACKS): XM_PARSER_STOP_ON_ERROR_FILTER

-- Like 'new_stop_on_error_filter' with next
-- filter.

-- (From XM_PARSER)

require
a_next_not_void: a_next /= Void
ensure
result_not_void: Result /= Void

feature -- Resolving external entity

dtd_resolver: XM_EXTERNAL_RESOLVER

-- Resolver for external DTD.

-- (From XM_PARSER)

entity_resolver: XM_EXTERNAL_RESOLVER

-- Resolver for external entities.

-- (From XM_PARSER)

set_dtd_resolver (a_resolver: like dtd_resolver)

-- Set resolver for external DTD.

-- (From XM_PARSER)

require
not_void: a_resolver /= Void
ensure
dtd_resolver_set: dtd_resolver = a_resolver
set_entity_resolver (a_resolver: like entity_resolver)

-- Set resolver for external entities.

-- (From XM_PARSER)

require
not_void: a_resolver /= Void
ensure
entity_resolver_set: entity_resolver = a_resolver
set_resolver (a_resolver: like dtd_resolver)

-- Set both entity and DTD resolvers to the same one.

-- (From XM_PARSER)

require
not_void: a_resolver /= Void
ensure
entity_resolver_set: entity_resolver = a_resolver
dtd_resolver_set: dtd_resolver = a_resolver

feature -- Parsing

parse_from_public (a_public: STRING; a_system: STRING)

-- Parse from public/system identifier using resolver.

-- (From XM_PARSER)

require
a_public_not_void: a_public /= Void
; a_system_not_void: a_system /= Void
parse_from_stream (a_stream: KI_CHARACTER_INPUT_STREAM)

-- Parse XML document from input stream.

-- (From XM_PARSER)

require
a_stream_not_void: a_stream /= Void
is_open_read: a_stream.is_open_read
parse_from_string (a_string: STRING)

-- Parse XML document from a_string.

-- (From XM_PARSER)

require
a_string_not_void: a_string /= Void
parse_from_system (a_system: STRING)

-- Parse from system identifier using resolver.

-- (From XM_PARSER)

require
a_system_not_void: a_system /= Void

feature

set_callbacks (a_callback: XM_CALLBACKS)

-- Client will receive callbacks to.

-- (From XM_CALLBACKS_SOURCE)

require
a_callback_not_void: a_callback /= Void
set_dtd_callbacks (a_callback: XM_DTD_CALLBACKS)

-- Client will receive callbacks to.

-- (From XM_DTD_CALLBACKS_SOURCE)

require
a_callback_not_void: a_callback /= Void

feature -- Copy

copy_string_mode (other: XM_STRING_MODE)

-- Copy string mode.

-- (From XM_STRING_MODE)

require
other_not_void: other /= Void
ensure
copied: same_string_mode (other)

feature -- Constants

xml_err_none: INTEGER

-- No error occurred

-- (From XM_ERROR_CODES)

xml_err_unknown: INTEGER

-- An unknown error occurred

-- (From XM_ERROR_CODES)

feature {XM_STRING_MODE} -- Implementation

string_mode: INTEGER

-- STRING/UC_STRING mode

-- (From XM_STRING_MODE)

invariant

-- From XM_PARSER
entity_resolver_not_void: entity_resolver /= Void
dtd_resolver_not_void: dtd_resolver /= Void

mode_set: BOOLEAN_.nxor (<<is_string_mode_ascii, is_string_mode_mixed, is_string_mode_unicode, is_string_mode_latin1>>)

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

end