Mercurial > cpython-lru_cache-weakref
annotate Doc/lib/xmlsaxreader.tex @ 20737:00a581bdedeb legacy-trunk
When overriding __str__ or __repr__, set the tp_print slot to NULL.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 29 Oct 2001 14:33:44 +0000 |
| parents | 33b4357aebb8 |
| children | b0a6dbc90047 |
| rev | line source |
|---|---|
|
15183
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
1 \section{\module{xml.sax.xmlreader} --- |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
2 Interface for XML parsers} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
3 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
4 \declaremodule{standard}{xml.sax.xmlreader} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
5 \modulesynopsis{Interface which SAX-compliant XML parsers must implement.} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
6 \sectionauthor{Martin v. L\"owis}{loewis@informatik.hu-berlin.de} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
7 \moduleauthor{Lars Marius Garshol}{larsga@garshol.priv.no} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
8 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
9 \versionadded{2.0} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
10 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
11 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
12 SAX parsers implement the \class{XMLReader} interface. They are |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
13 implemented in a Python module, which must provide a function |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
14 \function{create_parser()}. This function is invoked by |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
15 \function{xml.sax.make_parser()} with no arguments to create a new |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
16 parser object. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
17 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
18 \begin{classdesc}{XMLReader}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
19 Base class which can be inherited by SAX parsers. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
20 \end{classdesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
21 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
22 \begin{classdesc}{IncrementalParser}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
23 In some cases, it is desirable not to parse an input source at once, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
24 but to feed chunks of the document as they get available. Note that |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
25 the reader will normally not read the entire file, but read it in |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
26 chunks as well; still \method{parse()} won't return until the entire |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
27 document is processed. So these interfaces should be used if the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
28 blocking behaviour of \method{parse()} is not desirable. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
29 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
30 When the parser is instantiated it is ready to begin accepting data |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
31 from the feed method immediately. After parsing has been finished |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
32 with a call to close the reset method must be called to make the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
33 parser ready to accept new data, either from feed or using the parse |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
34 method. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
35 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
36 Note that these methods must \emph{not} be called during parsing, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
37 that is, after parse has been called and before it returns. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
38 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
39 By default, the class also implements the parse method of the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
40 XMLReader interface using the feed, close and reset methods of the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
41 IncrementalParser interface as a convenience to SAX 2.0 driver |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
42 writers. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
43 \end{classdesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
44 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
45 \begin{classdesc}{Locator}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
46 Interface for associating a SAX event with a document location. A |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
47 locator object will return valid results only during calls to |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
48 DocumentHandler methods; at any other time, the results are |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
49 unpredictable. If information is not available, methods may return |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
50 \code{None}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
51 \end{classdesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
52 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
53 \begin{classdesc}{InputSource}{\optional{systemId}} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
54 Encapsulation of the information needed by the \class{XMLReader} to |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
55 read entities. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
56 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
57 This class may include information about the public identifier, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
58 system identifier, byte stream (possibly with character encoding |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
59 information) and/or the character stream of an entity. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
60 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
61 Applications will create objects of this class for use in the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
62 \method{XMLReader.parse()} method and for returning from |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
63 EntityResolver.resolveEntity. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
64 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
65 An \class{InputSource} belongs to the application, the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
66 \class{XMLReader} is not allowed to modify \class{InputSource} objects |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
67 passed to it from the application, although it may make copies and |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
68 modify those. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
69 \end{classdesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
70 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
71 \begin{classdesc}{AttributesImpl}{attrs} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
72 This is a dictionary-like object which represents the element |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
73 attributes in a \method{startElement()} call. In addition to the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
74 most useful dictionary operations, it supports a number of other |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
75 methods as described below. Objects of this class should be |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
76 instantiated by readers; \var{attrs} must be a dictionary-like |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
77 object. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
78 \end{classdesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
79 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
80 \begin{classdesc}{AttributesNSImpl}{attrs, qnames} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
81 Namespace-aware variant of attributes, which will be passed to |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
82 \method{startElementNS()}. It is derived from \class{AttributesImpl}, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
83 but understands attribute names as two-tuples of \var{namespaceURI} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
84 and \var{localname}. In addition, it provides a number of methods |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
85 expecting qualified names as they appear in the original document. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
86 \end{classdesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
87 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
88 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
89 \subsection{XMLReader Objects \label{xmlreader-objects}} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
90 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
91 The \class{XMLReader} interface supports the following methods: |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
92 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
93 \begin{methoddesc}[XMLReader]{parse}{source} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
94 Process an input source, producing SAX events. The \var{source} |
|
18416
33b4357aebb8
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
Fred Drake <fdrake@acm.org>
parents:
15183
diff
changeset
|
95 object can be a system identifier (a string identifying the |
|
15183
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
96 input source -- typically a file name or an URL), a file-like |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
97 object, or an \class{InputSource} object. When \method{parse()} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
98 returns, the input is completely processed, and the parser object |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
99 can be discarded or reset. As a limitation, the current implementation |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
100 only accepts byte streams; processing of character streams is for |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
101 further study. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
102 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
103 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
104 \begin{methoddesc}[XMLReader]{getContentHandler}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
105 Return the current \class{ContentHandler}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
106 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
107 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
108 \begin{methoddesc}[XMLReader]{setContentHandler}{handler} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
109 Set the current \class{ContentHandler}. If no |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
110 \class{ContentHandler} is set, content events will be discarded. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
111 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
112 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
113 \begin{methoddesc}[XMLReader]{getDTDHandler}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
114 Return the current \class{DTDHandler}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
115 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
116 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
117 \begin{methoddesc}[XMLReader]{setDTDHandler}{handler} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
118 Set the current \class{DTDHandler}. If no \class{DTDHandler} is |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
119 set, DTD events will be discarded. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
120 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
121 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
122 \begin{methoddesc}[XMLReader]{getEntityResolver}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
123 Return the current \class{EntityResolver}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
124 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
125 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
126 \begin{methoddesc}[XMLReader]{setEntityResolver}{handler} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
127 Set the current \class{EntityResolver}. If no |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
128 \class{EntityResolver} is set, attempts to resolve an external |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
129 entity will result in opening the system identifier for the entity, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
130 and fail if it is not available. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
131 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
132 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
133 \begin{methoddesc}[XMLReader]{getErrorHandler}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
134 Return the current \class{ErrorHandler}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
135 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
136 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
137 \begin{methoddesc}[XMLReader]{setErrorHandler}{handler} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
138 Set the current error handler. If no \class{ErrorHandler} is set, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
139 errors will be raised as exceptions, and warnings will be printed. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
140 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
141 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
142 \begin{methoddesc}[XMLReader]{setLocale}{locale} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
143 Allow an application to set the locale for errors and warnings. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
144 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
145 SAX parsers are not required to provide localization for errors and |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
146 warnings; if they cannot support the requested locale, however, they |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
147 must throw a SAX exception. Applications may request a locale change |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
148 in the middle of a parse. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
149 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
150 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
151 \begin{methoddesc}[XMLReader]{getFeature}{featurename} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
152 Return the current setting for feature \var{featurename}. If the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
153 feature is not recognized, \exception{SAXNotRecognizedException} is |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
154 raised. The well-known featurenames are listed in the module |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
155 \module{xml.sax.handler}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
156 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
157 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
158 \begin{methoddesc}[XMLReader]{setFeature}{featurename, value} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
159 Set the \var{featurename} to \var{value}. If the feature is not |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
160 recognized, \exception{SAXNotRecognizedException} is raised. If the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
161 feature or its setting is not supported by the parser, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
162 \var{SAXNotSupportedException} is raised. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
163 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
164 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
165 \begin{methoddesc}[XMLReader]{getProperty}{propertyname} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
166 Return the current setting for property \var{propertyname}. If the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
167 property is not recognized, a \exception{SAXNotRecognizedException} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
168 is raised. The well-known propertynames are listed in the module |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
169 \module{xml.sax.handler}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
170 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
171 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
172 \begin{methoddesc}[XMLReader]{setProperty}{propertyname, value} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
173 Set the \var{propertyname} to \var{value}. If the property is not |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
174 recognized, \exception{SAXNotRecognizedException} is raised. If the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
175 property or its setting is not supported by the parser, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
176 \var{SAXNotSupportedException} is raised. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
177 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
178 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
179 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
180 \subsection{IncrementalParser Objects |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
181 \label{incremental-parser-objects}} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
182 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
183 Instances of \class{IncrementalParser} offer the following additional |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
184 methods: |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
185 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
186 \begin{methoddesc}[IncrementalParser]{feed}{data} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
187 Process a chunk of \var{data}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
188 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
189 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
190 \begin{methoddesc}[IncrementalParser]{close}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
191 Assume the end of the document. That will check well-formedness |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
192 conditions that can be checked only at the end, invoke handlers, and |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
193 may clean up resources allocated during parsing. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
194 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
195 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
196 \begin{methoddesc}[IncrementalParser]{reset}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
197 This method is called after close has been called to reset the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
198 parser so that it is ready to parse new documents. The results of |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
199 calling parse or feed after close without calling reset are |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
200 undefined.""" |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
201 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
202 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
203 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
204 \subsection{Locator Objects \label{locator-objects}} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
205 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
206 Instances of \class{Locator} provide these methods: |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
207 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
208 \begin{methoddesc}[Locator]{getColumnNumber}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
209 Return the column number where the current event ends. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
210 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
211 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
212 \begin{methoddesc}[Locator]{getLineNumber}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
213 Return the line number where the current event ends. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
214 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
215 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
216 \begin{methoddesc}[Locator]{getPublicId}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
217 Return the public identifier for the current event. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
218 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
219 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
220 \begin{methoddesc}[Locator]{getSystemId}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
221 Return the system identifier for the current event. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
222 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
223 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
224 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
225 \subsection{InputSource Objects \label{input-source-objects}} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
226 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
227 \begin{methoddesc}[InputSource]{setPublicId}{id} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
228 Sets the public identifier of this \class{InputSource}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
229 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
230 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
231 \begin{methoddesc}[InputSource]{getPublicId}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
232 Returns the public identifier of this \class{InputSource}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
233 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
234 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
235 \begin{methoddesc}[InputSource]{setSystemId}{id} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
236 Sets the system identifier of this \class{InputSource}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
237 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
238 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
239 \begin{methoddesc}[InputSource]{getSystemId}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
240 Returns the system identifier of this \class{InputSource}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
241 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
242 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
243 \begin{methoddesc}[InputSource]{setEncoding}{encoding} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
244 Sets the character encoding of this \class{InputSource}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
245 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
246 The encoding must be a string acceptable for an XML encoding |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
247 declaration (see section 4.3.3 of the XML recommendation). |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
248 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
249 The encoding attribute of the \class{InputSource} is ignored if the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
250 \class{InputSource} also contains a character stream. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
251 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
252 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
253 \begin{methoddesc}[InputSource]{getEncoding}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
254 Get the character encoding of this InputSource. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
255 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
256 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
257 \begin{methoddesc}[InputSource]{setByteStream}{bytefile} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
258 Set the byte stream (a Python file-like object which does not |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
259 perform byte-to-character conversion) for this input source. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
260 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
261 The SAX parser will ignore this if there is also a character stream |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
262 specified, but it will use a byte stream in preference to opening a |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
263 URI connection itself. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
264 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
265 If the application knows the character encoding of the byte stream, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
266 it should set it with the setEncoding method. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
267 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
268 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
269 \begin{methoddesc}[InputSource]{getByteStream}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
270 Get the byte stream for this input source. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
271 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
272 The getEncoding method will return the character encoding for this |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
273 byte stream, or None if unknown. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
274 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
275 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
276 \begin{methoddesc}[InputSource]{setCharacterStream}{charfile} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
277 Set the character stream for this input source. (The stream must be |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
278 a Python 1.6 Unicode-wrapped file-like that performs conversion to |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
279 Unicode strings.) |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
280 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
281 If there is a character stream specified, the SAX parser will ignore |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
282 any byte stream and will not attempt to open a URI connection to the |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
283 system identifier. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
284 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
285 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
286 \begin{methoddesc}[InputSource]{getCharacterStream}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
287 Get the character stream for this input source. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
288 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
289 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
290 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
291 \subsection{AttributesImpl Objects \label{attributes-impl-objects}} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
292 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
293 \class{AttributesImpl} objects implement a portion of the mapping |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
294 protocol, and the methods \method{copy()}, \method{get()}, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
295 \method{has_key()}, \method{items()}, \method{keys()}, and |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
296 \method{values()}. The following methods are also provided: |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
297 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
298 \begin{methoddesc}[AttributesImpl]{getLength}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
299 Return the number of attributes. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
300 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
301 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
302 \begin{methoddesc}[AttributesImpl]{getNames}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
303 Return the names of the attributes. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
304 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
305 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
306 \begin{methoddesc}[AttributesImpl]{getType}{name} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
307 Returns the type of the attribute \var{name}, which is normally |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
308 \code{'CDATA'}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
309 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
310 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
311 \begin{methoddesc}[AttributesImpl]{getValue}{name} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
312 Return the value of attribute \var{name}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
313 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
314 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
315 % getValueByQName, getNameByQName, getQNameByName, getQNames available |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
316 % here already, but documented only for derived class. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
317 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
318 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
319 \subsection{AttributesNSImpl Objects \label{attributes-ns-impl-objects}} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
320 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
321 \begin{methoddesc}[AttributesNSImpl]{getValueByQName}{name} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
322 Return the value for a qualified name. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
323 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
324 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
325 \begin{methoddesc}[AttributesNSImpl]{getNameByQName}{name} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
326 Return the \code{(\var{namespace}, \var{localname})} pair for a |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
327 qualified \var{name}. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
328 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
329 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
330 \begin{methoddesc}[AttributesNSImpl]{getQNameByName}{name} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
331 Return the qualified name for a \code{(\var{namespace}, |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
332 \var{localname})} pair. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
333 \end{methoddesc} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
334 |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
335 \begin{methoddesc}[AttributesNSImpl]{getQNames}{} |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
336 Return the qualified names of all attributes. |
|
4d2187264cfa
Massive addition of SAX documentation from Martin von Loewis
Fred Drake <fdrake@acm.org>
parents:
diff
changeset
|
337 \end{methoddesc} |
