|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' |
|
3 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> |
|
4 <html><head> |
|
5 <title>eric4.E4XML.XMLHandlerBase</title> |
|
6 <style> |
|
7 body { |
|
8 background:white; |
|
9 margin: 0em 1em 10em 1em; |
|
10 color: black; |
|
11 } |
|
12 |
|
13 h1 { color: white; background: #4FA4FF; } |
|
14 h2 { color: white; background: #4FA4FF; } |
|
15 h3 { color: white; background: #00557F; } |
|
16 h4 { color: white; background: #00557F; } |
|
17 |
|
18 a { color: #AA5500; } |
|
19 |
|
20 </style> |
|
21 </head> |
|
22 <body><a NAME="top" ID="top"></a> |
|
23 <h1>eric4.E4XML.XMLHandlerBase</h1> |
|
24 <p> |
|
25 Module implementing a base class for all of eric4s XML handlers. |
|
26 </p> |
|
27 <h3>Global Attributes</h3> |
|
28 <table> |
|
29 <tr><td>None</td></tr> |
|
30 </table> |
|
31 <h3>Classes</h3> |
|
32 <table> |
|
33 <tr> |
|
34 <td><a href="#XMLHandlerBase">XMLHandlerBase</a></td> |
|
35 <td>Class implementing the base class for al of eric4s XML handlers.</td> |
|
36 </tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 <table> |
|
40 <tr><td>None</td></tr> |
|
41 </table> |
|
42 <hr /><hr /> |
|
43 <a NAME="XMLHandlerBase" ID="XMLHandlerBase"></a> |
|
44 <h2>XMLHandlerBase</h2> |
|
45 <p> |
|
46 Class implementing the base class for al of eric4s XML handlers. |
|
47 </p> |
|
48 <h3>Derived from</h3> |
|
49 ContentHandler |
|
50 <h3>Class Attributes</h3> |
|
51 <table> |
|
52 <tr><td>None</td></tr> |
|
53 </table> |
|
54 <h3>Methods</h3> |
|
55 <table> |
|
56 <tr> |
|
57 <td><a href="#XMLHandlerBase.__init__">XMLHandlerBase</a></td> |
|
58 <td>Constructor</td> |
|
59 </tr><tr> |
|
60 <td><a href="#XMLHandlerBase._prepareBasics">_prepareBasics</a></td> |
|
61 <td>Protected method to prepare the parsing of XML for basic python types.</td> |
|
62 </tr><tr> |
|
63 <td><a href="#XMLHandlerBase.characters">characters</a></td> |
|
64 <td>Handler called for ordinary text.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#XMLHandlerBase.decodedNewLines">decodedNewLines</a></td> |
|
67 <td>Public method to decode newlines and paragraph breaks.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#XMLHandlerBase.defaultEndElement">defaultEndElement</a></td> |
|
70 <td>Handler method for the common end tags.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#XMLHandlerBase.defaultStartElement">defaultStartElement</a></td> |
|
73 <td>Handler method for common start tags.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#XMLHandlerBase.endBool">endBool</a></td> |
|
76 <td>Handler method for the "bool" end tag.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#XMLHandlerBase.endComplex">endComplex</a></td> |
|
79 <td>Handler method for the "complex" end tag.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#XMLHandlerBase.endDictionary">endDictionary</a></td> |
|
82 <td>Handler method for the "dictionary" end tag.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#XMLHandlerBase.endElement">endElement</a></td> |
|
85 <td>Handler called, when an ending tag is found.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#XMLHandlerBase.endFloat">endFloat</a></td> |
|
88 <td>Handler method for the "float" end tag.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#XMLHandlerBase.endInt">endInt</a></td> |
|
91 <td>Handler method for the "int" end tag.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#XMLHandlerBase.endList">endList</a></td> |
|
94 <td>Handler method for the "list" end tag.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#XMLHandlerBase.endLong">endLong</a></td> |
|
97 <td>Handler method for the "long" end tag.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#XMLHandlerBase.endNone">endNone</a></td> |
|
100 <td>Handler method for the "none" end tag.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#XMLHandlerBase.endPickle">endPickle</a></td> |
|
103 <td>Handler method for the "pickle" end tag.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#XMLHandlerBase.endString">endString</a></td> |
|
106 <td>Handler method for the "string" end tag.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#XMLHandlerBase.endTuple">endTuple</a></td> |
|
109 <td>Handler method for the "tuple" end tag.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#XMLHandlerBase.endUnicode">endUnicode</a></td> |
|
112 <td>Handler method for the "unicode" end tag.</td> |
|
113 </tr><tr> |
|
114 <td><a href="#XMLHandlerBase.startDictionary">startDictionary</a></td> |
|
115 <td>Handler method for the "dictionary" start tag.</td> |
|
116 </tr><tr> |
|
117 <td><a href="#XMLHandlerBase.startDocument">startDocument</a></td> |
|
118 <td>Handler called, when the document parsing is started.</td> |
|
119 </tr><tr> |
|
120 <td><a href="#XMLHandlerBase.startElement">startElement</a></td> |
|
121 <td>Handler called, when a starting tag is found.</td> |
|
122 </tr><tr> |
|
123 <td><a href="#XMLHandlerBase.startList">startList</a></td> |
|
124 <td>Handler method for the "list" start tag.</td> |
|
125 </tr><tr> |
|
126 <td><a href="#XMLHandlerBase.startPickle">startPickle</a></td> |
|
127 <td>Handler method for the "pickle" start tag.</td> |
|
128 </tr><tr> |
|
129 <td><a href="#XMLHandlerBase.startTuple">startTuple</a></td> |
|
130 <td>Handler method for the "tuple" start tag.</td> |
|
131 </tr><tr> |
|
132 <td><a href="#XMLHandlerBase.unescape">unescape</a></td> |
|
133 <td>Public method used to unescape certain characters.</td> |
|
134 </tr><tr> |
|
135 <td><a href="#XMLHandlerBase.utf8_to_code">utf8_to_code</a></td> |
|
136 <td>Public method to convert a string to unicode and encode it for XML.</td> |
|
137 </tr> |
|
138 </table> |
|
139 <a NAME="XMLHandlerBase.__init__" ID="XMLHandlerBase.__init__"></a> |
|
140 <h4>XMLHandlerBase (Constructor)</h4> |
|
141 <b>XMLHandlerBase</b>(<i></i>) |
|
142 <p> |
|
143 Constructor |
|
144 </p><a NAME="XMLHandlerBase._prepareBasics" ID="XMLHandlerBase._prepareBasics"></a> |
|
145 <h4>XMLHandlerBase._prepareBasics</h4> |
|
146 <b>_prepareBasics</b>(<i></i>) |
|
147 <p> |
|
148 Protected method to prepare the parsing of XML for basic python types. |
|
149 </p><a NAME="XMLHandlerBase.characters" ID="XMLHandlerBase.characters"></a> |
|
150 <h4>XMLHandlerBase.characters</h4> |
|
151 <b>characters</b>(<i>chars</i>) |
|
152 <p> |
|
153 Handler called for ordinary text. |
|
154 </p><dl> |
|
155 <dt><i>chars</i></dt> |
|
156 <dd> |
|
157 the scanned text (string) |
|
158 </dd> |
|
159 </dl><a NAME="XMLHandlerBase.decodedNewLines" ID="XMLHandlerBase.decodedNewLines"></a> |
|
160 <h4>XMLHandlerBase.decodedNewLines</h4> |
|
161 <b>decodedNewLines</b>(<i>text</i>) |
|
162 <p> |
|
163 Public method to decode newlines and paragraph breaks. |
|
164 </p><dl> |
|
165 <dt><i>text</i></dt> |
|
166 <dd> |
|
167 text to decode (string or QString) |
|
168 </dd> |
|
169 </dl><a NAME="XMLHandlerBase.defaultEndElement" ID="XMLHandlerBase.defaultEndElement"></a> |
|
170 <h4>XMLHandlerBase.defaultEndElement</h4> |
|
171 <b>defaultEndElement</b>(<i></i>) |
|
172 <p> |
|
173 Handler method for the common end tags. |
|
174 </p><a NAME="XMLHandlerBase.defaultStartElement" ID="XMLHandlerBase.defaultStartElement"></a> |
|
175 <h4>XMLHandlerBase.defaultStartElement</h4> |
|
176 <b>defaultStartElement</b>(<i>attrs</i>) |
|
177 <p> |
|
178 Handler method for common start tags. |
|
179 </p><dl> |
|
180 <dt><i>attrs</i></dt> |
|
181 <dd> |
|
182 list of tag attributes |
|
183 </dd> |
|
184 </dl><a NAME="XMLHandlerBase.endBool" ID="XMLHandlerBase.endBool"></a> |
|
185 <h4>XMLHandlerBase.endBool</h4> |
|
186 <b>endBool</b>(<i></i>) |
|
187 <p> |
|
188 Handler method for the "bool" end tag. |
|
189 </p><a NAME="XMLHandlerBase.endComplex" ID="XMLHandlerBase.endComplex"></a> |
|
190 <h4>XMLHandlerBase.endComplex</h4> |
|
191 <b>endComplex</b>(<i></i>) |
|
192 <p> |
|
193 Handler method for the "complex" end tag. |
|
194 </p><a NAME="XMLHandlerBase.endDictionary" ID="XMLHandlerBase.endDictionary"></a> |
|
195 <h4>XMLHandlerBase.endDictionary</h4> |
|
196 <b>endDictionary</b>(<i></i>) |
|
197 <p> |
|
198 Handler method for the "dictionary" end tag. |
|
199 </p><a NAME="XMLHandlerBase.endElement" ID="XMLHandlerBase.endElement"></a> |
|
200 <h4>XMLHandlerBase.endElement</h4> |
|
201 <b>endElement</b>(<i>name</i>) |
|
202 <p> |
|
203 Handler called, when an ending tag is found. |
|
204 </p><dl> |
|
205 <dt><i>name</i></dt> |
|
206 <dd> |
|
207 name of the tag (string) |
|
208 </dd> |
|
209 </dl><a NAME="XMLHandlerBase.endFloat" ID="XMLHandlerBase.endFloat"></a> |
|
210 <h4>XMLHandlerBase.endFloat</h4> |
|
211 <b>endFloat</b>(<i></i>) |
|
212 <p> |
|
213 Handler method for the "float" end tag. |
|
214 </p><a NAME="XMLHandlerBase.endInt" ID="XMLHandlerBase.endInt"></a> |
|
215 <h4>XMLHandlerBase.endInt</h4> |
|
216 <b>endInt</b>(<i></i>) |
|
217 <p> |
|
218 Handler method for the "int" end tag. |
|
219 </p><a NAME="XMLHandlerBase.endList" ID="XMLHandlerBase.endList"></a> |
|
220 <h4>XMLHandlerBase.endList</h4> |
|
221 <b>endList</b>(<i></i>) |
|
222 <p> |
|
223 Handler method for the "list" end tag. |
|
224 </p><a NAME="XMLHandlerBase.endLong" ID="XMLHandlerBase.endLong"></a> |
|
225 <h4>XMLHandlerBase.endLong</h4> |
|
226 <b>endLong</b>(<i></i>) |
|
227 <p> |
|
228 Handler method for the "long" end tag. |
|
229 </p><a NAME="XMLHandlerBase.endNone" ID="XMLHandlerBase.endNone"></a> |
|
230 <h4>XMLHandlerBase.endNone</h4> |
|
231 <b>endNone</b>(<i></i>) |
|
232 <p> |
|
233 Handler method for the "none" end tag. |
|
234 </p><a NAME="XMLHandlerBase.endPickle" ID="XMLHandlerBase.endPickle"></a> |
|
235 <h4>XMLHandlerBase.endPickle</h4> |
|
236 <b>endPickle</b>(<i></i>) |
|
237 <p> |
|
238 Handler method for the "pickle" end tag. |
|
239 </p><a NAME="XMLHandlerBase.endString" ID="XMLHandlerBase.endString"></a> |
|
240 <h4>XMLHandlerBase.endString</h4> |
|
241 <b>endString</b>(<i></i>) |
|
242 <p> |
|
243 Handler method for the "string" end tag. |
|
244 </p><a NAME="XMLHandlerBase.endTuple" ID="XMLHandlerBase.endTuple"></a> |
|
245 <h4>XMLHandlerBase.endTuple</h4> |
|
246 <b>endTuple</b>(<i></i>) |
|
247 <p> |
|
248 Handler method for the "tuple" end tag. |
|
249 </p><a NAME="XMLHandlerBase.endUnicode" ID="XMLHandlerBase.endUnicode"></a> |
|
250 <h4>XMLHandlerBase.endUnicode</h4> |
|
251 <b>endUnicode</b>(<i></i>) |
|
252 <p> |
|
253 Handler method for the "unicode" end tag. |
|
254 </p><a NAME="XMLHandlerBase.startDictionary" ID="XMLHandlerBase.startDictionary"></a> |
|
255 <h4>XMLHandlerBase.startDictionary</h4> |
|
256 <b>startDictionary</b>(<i>attrs</i>) |
|
257 <p> |
|
258 Handler method for the "dictionary" start tag. |
|
259 </p><dl> |
|
260 <dt><i>attrs</i></dt> |
|
261 <dd> |
|
262 list of tag attributes |
|
263 </dd> |
|
264 </dl><a NAME="XMLHandlerBase.startDocument" ID="XMLHandlerBase.startDocument"></a> |
|
265 <h4>XMLHandlerBase.startDocument</h4> |
|
266 <b>startDocument</b>(<i></i>) |
|
267 <p> |
|
268 Handler called, when the document parsing is started. |
|
269 </p><a NAME="XMLHandlerBase.startElement" ID="XMLHandlerBase.startElement"></a> |
|
270 <h4>XMLHandlerBase.startElement</h4> |
|
271 <b>startElement</b>(<i>name, attrs</i>) |
|
272 <p> |
|
273 Handler called, when a starting tag is found. |
|
274 </p><dl> |
|
275 <dt><i>name</i></dt> |
|
276 <dd> |
|
277 name of the tag (string) |
|
278 </dd><dt><i>attrs</i></dt> |
|
279 <dd> |
|
280 list of tag attributes |
|
281 </dd> |
|
282 </dl><a NAME="XMLHandlerBase.startList" ID="XMLHandlerBase.startList"></a> |
|
283 <h4>XMLHandlerBase.startList</h4> |
|
284 <b>startList</b>(<i>attrs</i>) |
|
285 <p> |
|
286 Handler method for the "list" start tag. |
|
287 </p><dl> |
|
288 <dt><i>attrs</i></dt> |
|
289 <dd> |
|
290 list of tag attributes |
|
291 </dd> |
|
292 </dl><a NAME="XMLHandlerBase.startPickle" ID="XMLHandlerBase.startPickle"></a> |
|
293 <h4>XMLHandlerBase.startPickle</h4> |
|
294 <b>startPickle</b>(<i>attrs</i>) |
|
295 <p> |
|
296 Handler method for the "pickle" start tag. |
|
297 </p><dl> |
|
298 <dt><i>attrs</i></dt> |
|
299 <dd> |
|
300 list of tag attributes |
|
301 </dd> |
|
302 </dl><a NAME="XMLHandlerBase.startTuple" ID="XMLHandlerBase.startTuple"></a> |
|
303 <h4>XMLHandlerBase.startTuple</h4> |
|
304 <b>startTuple</b>(<i>attrs</i>) |
|
305 <p> |
|
306 Handler method for the "tuple" start tag. |
|
307 </p><dl> |
|
308 <dt><i>attrs</i></dt> |
|
309 <dd> |
|
310 list of tag attributes |
|
311 </dd> |
|
312 </dl><a NAME="XMLHandlerBase.unescape" ID="XMLHandlerBase.unescape"></a> |
|
313 <h4>XMLHandlerBase.unescape</h4> |
|
314 <b>unescape</b>(<i>text, attribute = False</i>) |
|
315 <p> |
|
316 Public method used to unescape certain characters. |
|
317 </p><dl> |
|
318 <dt><i>text</i></dt> |
|
319 <dd> |
|
320 the text to unescape (string) |
|
321 </dd><dt><i>attribute</i></dt> |
|
322 <dd> |
|
323 flag indicating unescaping is done for an attribute |
|
324 </dd> |
|
325 </dl><a NAME="XMLHandlerBase.utf8_to_code" ID="XMLHandlerBase.utf8_to_code"></a> |
|
326 <h4>XMLHandlerBase.utf8_to_code</h4> |
|
327 <b>utf8_to_code</b>(<i>text</i>) |
|
328 <p> |
|
329 Public method to convert a string to unicode and encode it for XML. |
|
330 </p><dl> |
|
331 <dt><i>text</i></dt> |
|
332 <dd> |
|
333 the text to encode (string) |
|
334 </dd> |
|
335 </dl> |
|
336 <div align="right"><a href="#top">Up</a></div> |
|
337 <hr /> |
|
338 </body></html> |