Kaydet (Commit) 2dbc9cd9 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Do not use the default namespace for attributes.

Fixes http://bugs.debian.org/229885
üst 520c3414
......@@ -6,8 +6,7 @@ import re
import string
import warnings
warnings.warn("The xmllib module is obsolete. Use xml.sax instead.",
DeprecationWarning)
warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", DeprecationWarning)
del warnings
version = '0.3'
......@@ -641,20 +640,17 @@ class XMLParser:
aprefix, key = res.group('prefix', 'local')
if self.__map_case:
key = key.lower()
if aprefix is None:
aprefix = ''
if aprefix is not None:
ans = None
for t, d, nst in self.stack:
if aprefix in d:
ans = d[aprefix]
if ans is None and aprefix != '':
if ans is None:
ans = self.__namespaces.get(aprefix)
if ans is not None:
key = ans + ' ' + key
elif aprefix != '':
else:
key = aprefix + ':' + key
elif ns is not None:
key = ns + ' ' + key
nattrdict[key] = val
attrnamemap[key] = okey
attrdict = nattrdict
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment