13.12.4 InputSource Objects

setPublicId( id)
Sets the public identifier of this InputSource.

getPublicId( )
Returns the public identifier of this InputSource.

setSystemId( id)
Sets the system identifier of this InputSource.

getSystemId( )
Returns the system identifier of this InputSource.

setEncoding( encoding)
Sets the character encoding of this InputSource.

The encoding must be a string acceptable for an XML encoding declaration (see section 4.3.3 of the XML recommendation).

The encoding attribute of the InputSource is ignored if the InputSource also contains a character stream.

getEncoding( )
Get the character encoding 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.

The SAX parser will ignore this if there is also a character stream specified, but it will use a byte stream in preference to opening a URI connection itself.

If the application knows the character encoding of the byte stream, it should set it with the setEncoding method.

getByteStream( )
Get the byte stream for this input source.

The getEncoding method will return the character encoding for this byte stream, or None if unknown.

setCharacterStream( charfile)
Set the character stream for this input source. (The stream must be a Python 1.6 Unicode-wrapped file-like that performs conversion to Unicode strings.)

If there is a character stream specified, the SAX parser will ignore any byte stream and will not attempt to open a URI connection to the system identifier.

getCharacterStream( )
Get the character stream for this input source.

See About this document... for information on suggesting changes.