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

Skip to content

Commit 2ebfd09

Browse files
committed
Merge from PyXML:
[1.3] Added documentation of the namespace URI for elements with no namespace. [1.4] New property http://www.python.org/sax/properties/encoding. [1.5] Support optional string interning in pyexpat.
1 parent 0e2d881 commit 2ebfd09

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

Lib/xml/sax/handler.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,10 @@ def startElementNS(self, name, qname, attrs):
144144
(uri, localname) tuple, the qname parameter the raw XML 1.0
145145
name used in the source document, and the attrs parameter
146146
holds an instance of the Attributes class containing the
147-
attributes of the element."""
147+
attributes of the element.
148+
149+
The uri part of the name tuple is None for elements which have
150+
no namespace."""
148151

149152
def endElementNS(self, name, qname):
150153
"""Signals the end of an element in namespace mode.
@@ -315,7 +318,28 @@ def resolveEntity(self, publicId, systemId):
315318
# the current event.
316319
# access: read-only
317320

321+
property_encoding = "http://www.python.org/sax/properties/encoding"
322+
# data type: String
323+
# description: The name of the encoding to assume for input data.
324+
# access: write: set the encoding, e.g. established by a higher-level
325+
# protocol. May change during parsing (e.g. after
326+
# processing a META tag)
327+
# read: return the current encoding (possibly established through
328+
# auto-detection.
329+
# initial value: UTF-8
330+
#
331+
332+
property_interning_dict = "http://www.python.org/sax/properties/interning-dict"
333+
# data type: Dictionary
334+
# description: The dictionary used to intern common strings in the document
335+
# access: write: Request that the parser uses a specific dictionary, to
336+
# allow interning across different documents
337+
# read: return the current interning dictionary, or None
338+
#
339+
318340
all_properties = [property_lexical_handler,
319341
property_dom_node,
320342
property_declaration_handler,
321-
property_xml_string]
343+
property_xml_string,
344+
property_encoding,
345+
property_interning_dict]

0 commit comments

Comments
 (0)