mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #5027: The standard xml
namespace is now understood by
xml.sax.saxutils.XMLGenerator as being bound to http://www.w3.org/XML/1998/namespace. Patch by Troy J. Farrell.
This commit is contained in:
parent
c1a6836305
commit
6b03ee6033
4 changed files with 66 additions and 0 deletions
|
@ -100,6 +100,12 @@ class XMLGenerator(handler.ContentHandler):
|
|||
def _qname(self, name):
|
||||
"""Builds a qualified name from a (ns_url, localname) pair"""
|
||||
if name[0]:
|
||||
# Per http://www.w3.org/XML/1998/namespace, The 'xml' prefix is
|
||||
# bound by definition to http://www.w3.org/XML/1998/namespace. It
|
||||
# does not need to be declared and will not usually be found in
|
||||
# self._current_context.
|
||||
if 'http://www.w3.org/XML/1998/namespace' == name[0]:
|
||||
return 'xml:' + name[1]
|
||||
# The name is in a non-empty namespace
|
||||
prefix = self._current_context[name[0]]
|
||||
if prefix:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue