Basic interface for SAX error handlers.

Introduced classes

abstract class ErrorHandler

sax :: ErrorHandler

Basic interface for SAX error handlers.

All class definitions

abstract class ErrorHandler

sax $ ErrorHandler

Basic interface for SAX error handlers.
package_diagram sax::error_handler error_handler sax::sax_parse_exception sax_parse_exception sax::error_handler->sax::sax_parse_exception sax::sax_locator sax_locator sax::sax_parse_exception->sax::sax_locator ...sax::sax_locator ... ...sax::sax_locator->sax::sax_locator sax::xml_reader xml_reader sax::xml_reader->sax::error_handler sax::xml_filter xml_filter sax::xml_filter->sax::xml_reader sax::xml_filter... ... sax::xml_filter...->sax::xml_filter

Ancestors

module abstract_collection

core :: abstract_collection

Abstract collection classes and services.
module abstract_text

core :: abstract_text

Abstract class for manipulation of sequences of characters
module array

core :: array

This module introduces the standard array structure.
module bitset

core :: bitset

Services to handle BitSet
module bytes

core :: bytes

Services for byte streams and arrays
module circular_array

core :: circular_array

Efficient data structure to access both end of the sequence.
module codec_base

core :: codec_base

Base for codecs to use with streams
module codecs

core :: codecs

Group module for all codec-related manipulations
module collection

core :: collection

This module define several collection classes.
module core

core :: core

Standard classes and methods used by default by Nit programs and libraries.
module environ

core :: environ

Access to the environment variables of the process
module error

core :: error

Standard error-management infrastructure.
module exec

core :: exec

Invocation and management of operating system sub-processes.
module file

core :: file

File manipulations (create, read, write, etc.)
module fixed_ints

core :: fixed_ints

Basic integers of fixed-precision
module fixed_ints_text

core :: fixed_ints_text

Text services to complement fixed_ints
module flat

core :: flat

All the array-based text representations
module gc

core :: gc

Access to the Nit internal garbage collection mechanism
module hash_collection

core :: hash_collection

Introduce HashMap and HashSet.
module iso8859_1

core :: iso8859_1

Codec for ISO8859-1 I/O
module kernel

core :: kernel

Most basic classes and methods.
module list

core :: list

This module handle double linked lists
module math

core :: math

Mathematical operations
module native

core :: native

Native structures for text and bytes
module numeric

core :: numeric

Advanced services for Numeric types
module protocol

core :: protocol

module queue

core :: queue

Queuing data structures and wrappers
module range

core :: range

Module for range of discrete objects.
module re

core :: re

Regular expression support for all services based on Pattern
module ropes

core :: ropes

Tree-based representation of a String.
module sax_locator

sax :: sax_locator

Interface for associating a SAX event with a document location.
module sorter

core :: sorter

This module contains classes used to compare things and sorts arrays.
module stream

core :: stream

Input and output streams of characters
module text

core :: text

All the classes and methods related to the manipulation of text entities
module time

core :: time

Management of time and dates
module union_find

core :: union_find

union–find algorithm using an efficient disjoint-set data structure
module utf8

core :: utf8

Codec for UTF-8 I/O

Parents

module sax_parse_exception

sax :: sax_parse_exception

Encapsulates an XML parse error or warning.

Children

module xml_reader

sax :: xml_reader

Interface for reading an XML document using callbacks.

Descendants

module a_star-m

a_star-m

module ext

sax :: ext

Interfaces to optional SAX2 handlers.
module helpers

sax :: helpers

Contains "helper" classes, including support for bootstrapping SAX-based applications.
module lexer

saxophonit :: lexer

SAXophoNit’s lexer
module reader_model

saxophonit :: reader_model

Reader’s model.
module sax

sax :: sax

Core SAX APIs.
module saxophonit

saxophonit :: saxophonit

A SAX 2 parser in Nit.
module testing

saxophonit :: testing

Various utilities to help testing SAXophoNit (and SAX parsers in general).
module xml_filter

sax :: xml_filter

Interface for an XML filter.
module xml_filter_impl

sax :: xml_filter_impl

Base class for deriving an XML filter.
# Basic interface for SAX error handlers.
module sax::error_handler

import sax_parse_exception

# Basic interface for SAX error handlers.
#
# If a SAX application needs to implement customized error
# handling, it must implement this interface and then register an
# instance with the XML reader using the `sax::XMLReader.error_handler
# property. The parser will then report all errors and warnings
# through this interface.
#
# **WARNING:** If an application does *not* register an `ErrorHandler`,
# XML parsing errors will go unreported and bizarre behaviour may result.
#
# For XML processing errors, a SAX driver must use this interface
# instead of throwing an exception: it is up to the application
# to decide whether to throw an exception for different types of
# errors and warnings. Note, however, that there is no requirement that
# the parser continue to provide useful information after a call to
# `fatal_error` (in other words, a SAX driver class
# could catch an exception and report a `fatal_error`).
#
# Note: The original documentation comes from [SAX 2.0](http://www.saxproject.org).
#
# SEE: `sax::XMLReader.error_handler`
abstract class ErrorHandler

	# Receive notification of a warning.
	#
	# SAX parsers will use this method to report conditions that
	# are not errors or fatal errors as defined by the XML 1.0
	# recommendation. The default behaviour is to take no action.
	#
	# The SAX parser must continue to provide normal parsing events
	# after invoking this method: it should still be possible for the
	# application to process the document through to the end.
	#
	# Filters may use this method to report other, non-XML warnings
	# as well.
	#
	# Parameter:
	#
	# * `exception`: warning information encapsulated in a SAX parse
	# exception.
	fun warning(exception: SAXParseException) do end

	# Receive notification of a recoverable error.
	#
	# This corresponds to the definition of "error" in section 1.2
	# of the W3C XML 1.0 Recommendation. For example, a validating
	# parser would use this callback to report the violation of a
	# validity constraint. The default behaviour is to take no
	# action.
	#
	# The SAX parser must continue to provide normal parsing events
	# after invoking this method: it should still be possible for the
	# application to process the document through to the end. If the
	# application cannot do so, then the parser should report a fatal
	# error even if the XML 1.0 recommendation does not require it to
	# do so.
	#
	# Filters may use this method to report other, non-XML errors
	# as well.
	#
	# Parameter:
	#
	# * `exception`: error information encapsulated in a SAX parse
	# exception.
	fun error(exception: SAXParseException) do end

	# Receive notification of a non-recoverable error.
	#
	# This corresponds to the definition of "fatal error" in
	# section 1.2 of the W3C XML 1.0 Recommendation. For example, a
	# parser would use this callback to report the violation of a
	# well-formedness constraint.
	#
	# The application must assume that the document is unusable
	# after the parser has invoked this method, and should continue
	# (if at all) only for the sake of collecting additional error
	# messages: in fact, SAX parsers are free to stop reporting any
	# other events once this method has been invoked.
	#
	# Parameter:
	#
	# * `exception`: error information encapsulated in a SAX parse
	# exception.
	fun fatal_error(exception: SAXParseException) do
		exception.throw
	end
end
lib/sax/error_handler.nit:11,1--103,3