Basic interface for resolving entities.

Introduced classes

abstract class EntityResolver

sax :: EntityResolver

Basic interface for resolving entities.

All class definitions

abstract class EntityResolver

sax $ EntityResolver

Basic interface for resolving entities.
package_diagram sax::entity_resolver entity_resolver sax::input_source input_source sax::entity_resolver->sax::input_source core core sax::input_source->core ...core ... ...core->core sax::xml_reader xml_reader sax::xml_reader->sax::entity_resolver 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 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 input_source

sax :: input_source

A single input source for an XML entity.

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 resolving entities.
module sax::entity_resolver

import input_source

# Basic interface for resolving entities.
#
# If a SAX application needs to implement customized handling
# for external entities, it must implement this interface and
# register an instance with the SAX driver using the
# `sax::XMLReader.entity_resolver` property.
#
# The XML reader will then allow the application to intercept any
# external entities (including the external DTD subset and external
# parameter entities, if any) before including them.
#
# Many SAX applications will not need to implement this interface,
# but it will be especially useful for applications that build
# XML documents from databases or other specialised input sources,
# or for applications that use URI types other than URLs.
#
# The application can also use this interface to redirect system
# identifiers to local URIs or to look up replacements in a catalog
# (possibly by using the public identifier).
#
# Note: The original documentation comes from [SAX 2.0](http://www.saxproject.org).
#
# SEE: `sax::XMLReader.entity_resolver`
#
# SEE: `sax::InputSource`
abstract class EntityResolver

	# Allow the application to resolve external entities.
	#
	# The parser will call this method before opening any external
	# entity except the top-level document entity. Such entities include
	# the external DTD subset and external parameter entities referenced
	# within the DTD (in either case, only if the parser reads external
	# parameter entities), and external general entities referenced
	# within the document element (if the parser reads external general
	# entities). The application may request that the parser locate
	# the entity itself, that it use an alternative URI, or that it
	# use data provided by the application (as a character or byte
	# input stream).
	#
	# Application writers can use this method to redirect external
	# system identifiers to secure and/or local URIs, to look up
	# public identifiers in a catalogue, or to read an entity from a
	# database or other input source (including, for example, a dialog
	# box). Neither XML nor SAX specifies a preferred policy for using
	# public or system IDs to resolve resources. However, SAX specifies
	# how to interpret any InputSource returned by this method, and that
	# if none is returned, then the system ID will be dereferenced as
	# a URL.
	#
	# If the system identifier is a URL, the SAX parser must
	# resolve it fully before reporting it to the application.
	#
	# Parameters:
	#
	# * `public_id`: public identifier of the external entity
	# being referenced, or `null` if none was supplied.
	# * `system_id`: system identifier of the external entity
	# being referenced.
	#
	# Returns:
	#
	# An `InputSource` object describing the new input source,
	# or `null` to request that the parser open a regular
	# URI connection to the system identifier.
	fun resolve_entity(public_id: nullable String, system_id: nullable String):
			nullable InputSource do
		return null
	end
end
lib/sax/entity_resolver.nit:11,1--85,3