Changeset 391 for python/trunk/Doc/library/xml.sax.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/xml.sax.rst
r2 r391 17 17 the SAX API. 18 18 19 20 .. warning:: 21 22 The :mod:`xml.sax` module is not secure against maliciously 23 constructed data. If you need to parse untrusted or unauthenticated data see 24 :ref:`xml-vulnerabilities`. 25 26 19 27 The convenience functions are: 20 28 … … 22 30 .. function:: make_parser([parser_list]) 23 31 24 Create and return a SAX :class:`XMLReader` object. The first parser found will 32 Create and return a SAX :class:`~xml.sax.xmlreader.XMLReader` object. The 33 first parser found will 25 34 be used. If *parser_list* is provided, it must be a sequence of strings which 26 35 name modules that have a function named :func:`create_parser`. Modules listed … … 32 41 Create a SAX parser and use it to parse a document. The document, passed in as 33 42 *filename_or_stream*, can be a filename or a file object. The *handler* 34 parameter needs to be a SAX :class:`ContentHandler` instance. If 35 *error_handler* is given, it must be a SAX :class:`ErrorHandler` instance; if 43 parameter needs to be a SAX :class:`~handler.ContentHandler` instance. If 44 *error_handler* is given, it must be a SAX :class:`~handler.ErrorHandler` 45 instance; if 36 46 omitted, :exc:`SAXParseException` will be raised on all errors. There is no 37 47 return value; all work must be done by the *handler* passed in. … … 58 68 notion of interface, they are formally introduced as classes, but applications 59 69 may use implementations which do not inherit from the provided classes. The 60 :class:`InputSource`, :class:`Locator`, :class:`Attributes`, 61 :class:`AttributesNS`, and :class:`XMLReader` interfaces are defined in the 70 :class:`~xml.sax.xmlreader.InputSource`, :class:`~xml.sax.xmlreader.Locator`, 71 :class:`~xml.sax.xmlreader.Attributes`, :class:`~xml.sax.xmlreader.AttributesNS`, 72 and :class:`~xml.sax.xmlreader.XMLReader` interfaces are defined in the 62 73 module :mod:`xml.sax.xmlreader`. The handler interfaces are defined in 63 :mod:`xml.sax.handler`. For convenience, :class:`InputSource` (which is often 74 :mod:`xml.sax.handler`. For convenience, 75 :class:`~xml.sax.xmlreader.InputSource` (which is often 64 76 instantiated directly) and the handler classes are also available from 65 77 :mod:`xml.sax`. These interfaces are described below. … … 74 86 warning information from either the XML parser or the application: it can be 75 87 subclassed to provide additional functionality or to add localization. Note 76 that although the handlers defined in the :class:`ErrorHandler` interface 88 that although the handlers defined in the 89 :class:`~xml.sax.handler.ErrorHandler` interface 77 90 receive instances of this exception, it is not required to actually raise the 78 91 exception --- it is also useful as a container for information. … … 87 100 .. exception:: SAXParseException(msg, exception, locator) 88 101 89 Subclass of :exc:`SAXException` raised on parse errors. Instances of this class 90 are passed to the methods of the SAX :class:`ErrorHandler` interface to provide 91 information about the parse error. This class supports the SAX :class:`Locator` 92 interface as well as the :class:`SAXException` interface. 102 Subclass of :exc:`SAXException` raised on parse errors. Instances of this 103 class are passed to the methods of the SAX 104 :class:`~xml.sax.handler.ErrorHandler` interface to provide information 105 about the parse error. This class supports the SAX 106 :class:`~xml.sax.xmlreader.Locator` interface as well as the 107 :class:`SAXException` interface. 93 108 94 109 95 110 .. exception:: SAXNotRecognizedException(msg[, exception]) 96 111 97 Subclass of :exc:`SAXException` raised when a SAX :class:`XMLReader` is 112 Subclass of :exc:`SAXException` raised when a SAX 113 :class:`~xml.sax.xmlreader.XMLReader` is 98 114 confronted with an unrecognized feature or property. SAX applications and 99 115 extensions may use this class for similar purposes. … … 102 118 .. exception:: SAXNotSupportedException(msg[, exception]) 103 119 104 Subclass of :exc:`SAXException` raised when a SAX :class:`XMLReader` is asked to 120 Subclass of :exc:`SAXException` raised when a SAX 121 :class:`~xml.sax.xmlreader.XMLReader` is asked to 105 122 enable a feature that is not supported, or to set a property to a value that the 106 123 implementation does not support. SAX applications and extensions may use this
Note:
See TracChangeset
for help on using the changeset viewer.