\ddZddlZejdddkrddlmZ[GddeZGdd eZGd d eZGd d eZGddeZ dS)z!Different kinds of SAX ExceptionsNjava) Exceptionc2eZdZdZddZdZdZdZdZdS) SAXExceptionaEncapsulate an XML error or warning. This class can contain basic error or warning information from either the XML parser or the application: you can subclass it to provide additional functionality, or to add localization. Note that although you will receive a SAXException as the argument to the handlers in the ErrorHandler interface, you are not actually required to raise the exception; instead, you can simply read the information in it.NcL||_||_tj||dS)zUCreates an exception. The message is required, but the exception is optional.N)_msg _exceptionr__init__)selfmsg exceptions $..\python\lib\xml\sax\_exceptions.pyr zSAXException.__init__s+ #4%%%%%c|jS)z$Return a message for this exception.r r s r getMessagezSAXException.getMessage yrc|jS)z9Return the embedded exception, or None if there was none.)r rs r getExceptionzSAXException.getExceptions rc|jS)0Create a string representation of the exception.rrs r__str__zSAXException.__str__"rrc td)zvAvoids weird error messages if someone does exception[ix] by mistake, since Exception has __getitem__ defined. __getitem__)AttributeError)r ixs rrzSAXException.__getitem__&s]+++r)N) __name__ __module__ __qualname____doc__r rrrrrrrr sn  &&&&,,,,,rrc6eZdZdZdZdZdZdZdZdZ dS) SAXParseExceptiona#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 raise 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.ct|||||_|j|_|j|_|j|_dS)zECreates the exception. The exception parameter is allowed to be None.N) rr _locator getSystemId _systemIdgetColumnNumber_colnum getLineNumber_linenum)r r rlocators rr zSAXParseException.__init__;sfdC333 2244}4466  3355 rc|jS)zNThe column number of the end of the text where the exception occurred.)r+rs rr*z!SAXParseException.getColumnNumberHs |rc|jS)zDThe line number of the end of the text where the exception occurred.)r-rs rr,zSAXParseException.getLineNumberMs }rc4|jS)zEGet the public identifier of the entity where the exception occurred.)r' getPublicIdrs rr2zSAXParseException.getPublicIdQs}((***rc|jS)zEGet the system identifier of the entity where the exception occurred.)r)rs rr(zSAXParseException.getSystemIdUs ~rc|}|d}|}|d}|}|d}|d|d|d|jS)rNz ?:z: )r(r,r*r )r sysidlinenumcolnums rrzSAXParseException.__str__Ysr  "" =E$$&& ?G%%'' >F!&CCrN) rr r!r"r r*r,r2r(rr#rrr%r%.s} . . 6 6 6 +++ D D D D Drr%ceZdZdZdS)SAXNotRecognizedExceptionzException class for an unrecognized identifier. An XMLReader will raise this exception when it is confronted with an unrecognized feature or property. SAX applications and extensions may use this class for similar purposes.Nrr r!r"r#rrr;r;is,,,,rr;ceZdZdZdS)SAXNotSupportedExceptionaException class for an unsupported operation. An XMLReader will raise this exception when a service it cannot perform is requested (specifically setting a state or value). SAX applications and extensions may use this class for similar purposes.Nr<r#rrr>r>ssrr>ceZdZdZdS)SAXReaderNotAvailableaException class for a missing driver. An XMLReader module (driver) should raise this exception when it is first imported, e.g. when a support module cannot be imported. It also may be raised during parsing, e.g. if executing an external program is not permitted.Nr<r#rrr@r@}s!!!!rr@) r"sysplatform java.langrrr%r;r>r@r#rrrDs&'' <v###### , , , , ,9 , , ,J6D6D6D6D6D 6D6D6Dv,,,,, ,,,|!!!!!4!!!!!r