A single input source for an XML entity.

Introduced classes

class InputSource

sax :: InputSource

A single input source for an XML entity.

All class definitions

class InputSource

sax $ InputSource

A single input source for an XML entity.
package_diagram sax::input_source input_source core core sax::input_source->core sax::entity_resolver entity_resolver sax::entity_resolver->sax::input_source sax::xml_reader xml_reader sax::xml_reader->sax::entity_resolver sax::xml_reader... ... sax::xml_reader...->sax::xml_reader

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 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 core

core :: core

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

Children

module entity_resolver

sax :: entity_resolver

Basic interface for resolving entities.

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.
module xml_reader

sax :: xml_reader

Interface for reading an XML document using callbacks.
# A single input source for an XML entity.
module sax::input_source

# A single input source for an XML entity.
#
# This class allows a SAX application to encapsulate information
# about an input source in a single object, which may include
# a public identifier, a system identifier and a stream (possibly
# with a specified encoding).
#
# There are two places that the application can deliver an
# input source to the parser: as the argument to the `XMLReader.parse`
# method, or as the return value of the `EntityResolver.resolve_entity`
# method.
#
# The SAX parser will use the `InputSource` object to determine how to read XML
# input. If there is a byte stream, the parser will use that byte stream, using
# the encoding specified in the InputSource or else (if no encoding is
# specified) autodetecting the character encoding using an algorithm
# such as the one in the XML specification. If no byte stream is available, the
# parser will attempt to open a URI connection to the resource identified by
# the system identifier.
#
# An InputSource object belongs to the application: the SAX parser
# shall never modify it in any way (it may modify a copy if
# necessary). However, standard processing of the stream is to close it on as
# part of end-of-parse cleanup, so applications should not attempt to re-use
# such streams after they have been handed to a parser.
#
# Note: The original documentation comes, in part,
# from [SAX 2.0](http://www.saxproject.org).
class InputSource

	# Create a new input source with the specified system identifier.
	#
	# Applications may use `public_id=` to include a public identifier as well,
	# or `encoding=` to specify the character encoding, if known.
	#
	# If the system identifier is a URL, it must be fully resolved (it may not
	# be a relative URL).
	init with_system_id(system_id: String) do
		self.system_id = system_id
	end

	# Create a new input source with the specified stream.
	#
	# Application writers should use `system_id=` to provide a base for
	# resolving relative URIs, may use `public_id=` to include a public
	# identifier, and may use `encoding=` to specify the object's character
	# encoding.
	init with_stream(stream: Reader) do
		self.stream = stream
	end

	# The public identifier as a string.
	#
	# The public identifier is always optional: if the application
	# writer includes one, it will be provided as part of the
	# location information.
	var public_id: nullable String = null is writable

	# The system identifier as a string.
	#
	# If its an URL, it must be fully resolved (it may not be a relative URL).
	#
	# Applications may set `public_id` to include a
	# public identifier as well, or set `encoding` to specify
	# the character encoding, if known.
	var system_id: nullable String = null is writable

	# The stream containing the document.
	#
	# Application writers should set `system_id` to provide a base
	# for resolving relative URIs, may set `public_id` to include a
	# public identifier, and may set `encoding` to specify the object's
	# character encoding.
	var stream: nullable Reader = null is writable

	# The character encoding, if known.
	#
	# The encoding must be a string acceptable for an
	# XML encoding declaration (see section 4.3.3 of the XML 1.0
	# recommendation).
	var encoding: nullable String = null is writable
end
lib/sax/input_source.nit:11,1--95,3