xml.sax.InputSource

class xml.sax.InputSource(system_id=None)[source]

Encapsulation of the information needed by the XMLReader to read entities.

This class may include information about the public identifier, system identifier, byte stream (possibly with character encoding information) and/or the character stream of an entity.

Applications will create objects of this class for use in the XMLReader.parse method and for returning from EntityResolver.resolveEntity.

An InputSource belongs to the application, the XMLReader is not allowed to modify InputSource objects passed to it from the application, although it may make copies and modify those.

Methods

__init__([system_id])
getByteStream() Get the byte stream for this input source.
getCharacterStream() Get the character stream for this input source.
getEncoding() Get the character encoding of this InputSource.
getPublicId() Returns the public identifier of this InputSource.
getSystemId() Returns the system identifier of this InputSource.
setByteStream(bytefile) Set the byte stream (a Python file-like object which does not perform byte-to-character conversion) for this input source.
setCharacterStream(charfile) Set the character stream for this input source.
setEncoding(encoding) Sets the character encoding of this InputSource.
setPublicId(public_id) Sets the public identifier of this InputSource.
setSystemId(system_id) Sets the system identifier of this InputSource.