|
10 | 10 | """ |
11 | 11 |
|
12 | 12 | version = '2.0beta' |
| 13 | + |
13 | 14 | #============================================================================ |
14 | 15 | # |
15 | 16 | # HANDLER INTERFACES |
16 | 17 | # |
17 | 18 | #============================================================================ |
| 19 | + |
18 | 20 | # ===== ErrorHandler ===== |
| 21 | + |
19 | 22 | class ErrorHandler: |
20 | 23 | """Basic interface for SAX error handlers. If you create an object |
21 | 24 | that implements this interface, then register the object with your |
@@ -119,20 +122,34 @@ def endPrefixMapping(self, prefix): |
119 | 122 | of endPrefixMapping events is not otherwise guaranteed.""" |
120 | 123 |
|
121 | 124 | def startElement(self, name, attrs): |
122 | | - """Signals the start of an element. |
| 125 | + """Signals the start of an element in non-namespace mode. |
| 126 | +
|
| 127 | + The name parameter contains the raw XML 1.0 name of the |
| 128 | + element type as a string and the attrs parameter holds an |
| 129 | + instance of the Attributes class containing the attributes of |
| 130 | + the element.""" |
| 131 | + |
| 132 | + def endElement(self, name): |
| 133 | + """Signals the end of an element in non-namespace mode. |
| 134 | +
|
| 135 | + The name parameter contains the name of the element type, just |
| 136 | + as with the startElement event.""" |
| 137 | + |
| 138 | + def startElementNS(self, name, qname, attrs): |
| 139 | + """Signals the start of an element in namespace mode. |
123 | 140 |
|
124 | 141 | The name parameter contains the name of the element type as a |
125 | | - (uri ,localname) tuple, the qname parameter the raw XML 1.0 |
| 142 | + (uri, localname) tuple, the qname parameter the raw XML 1.0 |
126 | 143 | name used in the source document, and the attrs parameter |
127 | 144 | holds an instance of the Attributes class containing the |
128 | 145 | attributes of the element.""" |
129 | 146 |
|
130 | | - def endElement(self, name ): |
131 | | - """Signals the end of an element. |
| 147 | + def endElementNS(self, name, qname): |
| 148 | + """Signals the end of an element in namespace mode. |
132 | 149 |
|
133 | 150 | The name parameter contains the name of the element type, just |
134 | | - as with the startElement event.""" |
135 | | - |
| 151 | + as with the startElementNS event.""" |
| 152 | + |
136 | 153 | def characters(self, content): |
137 | 154 | """Receive notification of character data. |
138 | 155 | |
|
0 commit comments