Fixed tostring bug when using mapped namespaces.

This commit is contained in:
Lance Stout 2010-10-01 12:41:35 -04:00
parent bb219595a7
commit 2662131124
2 changed files with 2 additions and 2 deletions

View file

@ -46,7 +46,7 @@ def tostring(xml=None, xmlns='', stanza_ns='', stream=None, outbuffer=''):
if stream and tag_xmlns in stream.namespace_map:
mapped_namespace = stream.namespace_map[tag_xmlns]
if mapped_namespace:
tag = "%s:%s" % (mapped_namespace, tag_name)
tag_name = "%s:%s" % (mapped_namespace, tag_name)
output.append("<%s" % tag_name)
output.append(namespace)

View file

@ -49,7 +49,7 @@ def tostring(xml=None, xmlns='', stanza_ns='', stream=None, outbuffer=''):
if stream and tag_xmlns in stream.namespace_map:
mapped_namespace = stream.namespace_map[tag_xmlns]
if mapped_namespace:
tag = u"%s:%s" % (mapped_namespace, tag_name)
tag_name = u"%s:%s" % (mapped_namespace, tag_name)
output.append(u"<%s" % tag_name)
output.append(namespace)