Back to index

python3.2  3.2.2
Public Member Functions | Private Attributes
xml.sax._exceptions.SAXParseException Class Reference
Inheritance diagram for xml.sax._exceptions.SAXParseException:
Inheritance graph
[legend]
Collaboration diagram for xml.sax._exceptions.SAXParseException:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getColumnNumber
def getLineNumber
def getPublicId
def getSystemId
def __str__
def getMessage
def getException
def __getitem__

Private Attributes

 _locator
 _systemId
 _colnum
 _linenum

Detailed Description

Encapsulate an XML parse error or warning.

This exception will include information for locating the error in
the original XML document. Note that although the application will
receive a SAXParseException as the argument to the handlers in the
ErrorHandler interface, the application is not actually required
to throw the exception; instead, it can simply read the
information in it and take a different action.

Since this exception is a subclass of SAXException, it inherits
the ability to wrap another exception.

Definition at line 46 of file _exceptions.py.


Constructor & Destructor Documentation

def xml.sax._exceptions.SAXParseException.__init__ (   self,
  msg,
  exception,
  locator 
)

Definition at line 59 of file _exceptions.py.

00059 
00060     def __init__(self, msg, exception, locator):
00061         "Creates the exception. The exception parameter is allowed to be None."
00062         SAXException.__init__(self, msg, exception)
00063         self._locator = locator
00064 
00065         # We need to cache this stuff at construction time.
00066         # If this exception is thrown, the objects through which we must
00067         # traverse to get this information may be deleted by the time
00068         # it gets caught.
00069         self._systemId = self._locator.getSystemId()
00070         self._colnum = self._locator.getColumnNumber()
00071         self._linenum = self._locator.getLineNumber()

Here is the caller graph for this function:


Member Function Documentation

def xml.sax._exceptions.SAXException.__getitem__ (   self,
  ix 
) [inherited]
Avoids weird error messages if someone does exception[ix] by
mistake, since Exception has __getitem__ defined.

Definition at line 38 of file _exceptions.py.

00038 
00039     def __getitem__(self, ix):
00040         """Avoids weird error messages if someone does exception[ix] by
00041         mistake, since Exception has __getitem__ defined."""
00042         raise AttributeError("__getitem__")
00043 
00044 
00045 # ===== SAXPARSEEXCEPTION =====

Reimplemented from xml.sax._exceptions.SAXException.

Definition at line 89 of file _exceptions.py.

00089 
00090     def __str__(self):
00091         "Create a string representation of the exception."
00092         sysid = self.getSystemId()
00093         if sysid is None:
00094             sysid = "<unknown>"
00095         linenum = self.getLineNumber()
00096         if linenum is None:
00097             linenum = "?"
00098         colnum = self.getColumnNumber()
00099         if colnum is None:
00100             colnum = "?"
00101         return "%s:%s:%s: %s" % (sysid, linenum, colnum, self._msg)
00102 
00103 
00104 # ===== SAXNOTRECOGNIZEDEXCEPTION =====

Here is the call graph for this function:

The column number of the end of the text where the exception
occurred.

Definition at line 72 of file _exceptions.py.

00072 
00073     def getColumnNumber(self):
00074         """The column number of the end of the text where the exception
00075         occurred."""
00076         return self._colnum

Here is the caller graph for this function:

Definition at line 30 of file _exceptions.py.

00030 
00031     def getException(self):
00032         "Return the embedded exception, or None if there was none."
00033         return self._exception

Definition at line 77 of file _exceptions.py.

00077 
00078     def getLineNumber(self):
00079         "The line number of the end of the text where the exception occurred."
00080         return self._linenum

Here is the caller graph for this function:

def xml.sax._exceptions.SAXException.getMessage (   self) [inherited]

Definition at line 26 of file _exceptions.py.

00026 
00027     def getMessage(self):
00028         "Return a message for this exception."
00029         return self._msg

Definition at line 81 of file _exceptions.py.

00081 
00082     def getPublicId(self):
00083         "Get the public identifier of the entity where the exception occurred."
00084         return self._locator.getPublicId()

Definition at line 85 of file _exceptions.py.

00085 
00086     def getSystemId(self):
00087         "Get the system identifier of the entity where the exception occurred."
00088         return self._systemId

Here is the caller graph for this function:


Member Data Documentation

Definition at line 69 of file _exceptions.py.

Definition at line 70 of file _exceptions.py.

Definition at line 62 of file _exceptions.py.

Definition at line 68 of file _exceptions.py.


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