Back to index

python3.2  3.2.2
Public Member Functions | Private Attributes
xml.sax.xmlreader.InputSource Class Reference

List of all members.

Public Member Functions

def __init__
def setPublicId
def getPublicId
def setSystemId
def getSystemId
def setEncoding
def getEncoding
def setByteStream
def getByteStream
def setCharacterStream
def getCharacterStream

Private Attributes

 __system_id
 __public_id
 __encoding
 __bytefile
 __charfile

Detailed Description

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.

Definition at line 187 of file xmlreader.py.


Constructor & Destructor Documentation

def xml.sax.xmlreader.InputSource.__init__ (   self,
  system_id = None 
)

Definition at line 203 of file xmlreader.py.

00203 
00204     def __init__(self, system_id = None):
00205         self.__system_id = system_id
00206         self.__public_id = None
00207         self.__encoding  = None
00208         self.__bytefile  = None
00209         self.__charfile  = None

Here is the caller graph for this function:


Member Function Documentation

Get the byte stream for this input source.

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

Definition at line 253 of file xmlreader.py.

00253 
00254     def getByteStream(self):
00255         """Get the byte stream for this input source.
00256 
00257         The getEncoding method will return the character encoding for
00258         this byte stream, or None if unknown."""
00259         return self.__bytefile

Definition at line 270 of file xmlreader.py.

00270 
00271     def getCharacterStream(self):
00272         "Get the character stream for this input source."
00273         return self.__charfile
00274 
00275 # ===== ATTRIBUTESIMPL =====

Definition at line 236 of file xmlreader.py.

00236 
00237     def getEncoding(self):
00238         "Get the character encoding of this InputSource."
00239         return self.__encoding

Definition at line 214 of file xmlreader.py.

00214 
00215     def getPublicId(self):
00216         "Returns the public identifier of this InputSource."
00217         return self.__public_id

Definition at line 222 of file xmlreader.py.

00222 
00223     def getSystemId(self):
00224         "Returns the system identifier of this InputSource."
00225         return self.__system_id

def xml.sax.xmlreader.InputSource.setByteStream (   self,
  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.

Definition at line 240 of file xmlreader.py.

00240 
00241     def setByteStream(self, bytefile):
00242         """Set the byte stream (a Python file-like object which does
00243         not perform byte-to-character conversion) for this input
00244         source.
00245 
00246         The SAX parser will ignore this if there is also a character
00247         stream specified, but it will use a byte stream in preference
00248         to opening a URI connection itself.
00249 
00250         If the application knows the character encoding of the byte
00251         stream, it should set it with the setEncoding method."""
00252         self.__bytefile = bytefile

def xml.sax.xmlreader.InputSource.setCharacterStream (   self,
  charfile 
)
Set the character stream for this input source. (The stream
must be a Python 2.0 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.

Definition at line 260 of file xmlreader.py.

00260 
00261     def setCharacterStream(self, charfile):
00262         """Set the character stream for this input source. (The stream
00263         must be a Python 2.0 Unicode-wrapped file-like that performs
00264         conversion to Unicode strings.)
00265 
00266         If there is a character stream specified, the SAX parser will
00267         ignore any byte stream and will not attempt to open a URI
00268         connection to the system identifier."""
00269         self.__charfile = charfile

def xml.sax.xmlreader.InputSource.setEncoding (   self,
  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.

Definition at line 226 of file xmlreader.py.

00226 
00227     def setEncoding(self, encoding):
00228         """Sets the character encoding of this InputSource.
00229 
00230         The encoding must be a string acceptable for an XML encoding
00231         declaration (see section 4.3.3 of the XML recommendation).
00232 
00233         The encoding attribute of the InputSource is ignored if the
00234         InputSource also contains a character stream."""
00235         self.__encoding = encoding

def xml.sax.xmlreader.InputSource.setPublicId (   self,
  public_id 
)

Definition at line 210 of file xmlreader.py.

00210 
00211     def setPublicId(self, public_id):
00212         "Sets the public identifier of this InputSource."
00213         self.__public_id = public_id

def xml.sax.xmlreader.InputSource.setSystemId (   self,
  system_id 
)

Definition at line 218 of file xmlreader.py.

00218 
00219     def setSystemId(self, system_id):
00220         "Sets the system identifier of this InputSource."
00221         self.__system_id = system_id


Member Data Documentation

Definition at line 207 of file xmlreader.py.

Definition at line 208 of file xmlreader.py.

Definition at line 206 of file xmlreader.py.

Definition at line 205 of file xmlreader.py.

Definition at line 204 of file xmlreader.py.


The documentation for this class was generated from the following file: