Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b4d6bb0

Browse files
committed
Updated to correct DocumentHandler signatures. (patch 101570)
1 parent 39fb28f commit b4d6bb0

1 file changed

Lines changed: 23 additions & 6 deletions

File tree

Lib/xml/sax/handler.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
"""
1111

1212
version = '2.0beta'
13+
1314
#============================================================================
1415
#
1516
# HANDLER INTERFACES
1617
#
1718
#============================================================================
19+
1820
# ===== ErrorHandler =====
21+
1922
class ErrorHandler:
2023
"""Basic interface for SAX error handlers. If you create an object
2124
that implements this interface, then register the object with your
@@ -119,20 +122,34 @@ def endPrefixMapping(self, prefix):
119122
of endPrefixMapping events is not otherwise guaranteed."""
120123

121124
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.
123140
124141
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
126143
name used in the source document, and the attrs parameter
127144
holds an instance of the Attributes class containing the
128145
attributes of the element."""
129146

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.
132149
133150
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+
136153
def characters(self, content):
137154
"""Receive notification of character data.
138155

0 commit comments

Comments
 (0)