comparison emeraldtree/ElementTree.py @ 48:547347034e65

ElementTree - Change handling of undefined namespace
author Bastian Blank <bblank@thinkmo.de>
date Tue, 12 Aug 2008 13:10:33 +0200
parents e647f30cc08e
children d3767204a325
comparison
equal deleted inserted replaced
47:e647f30cc08e 48:547347034e65
737 if prefix: 737 if prefix:
738 qnames[qname] = encode("%s:%s" % (prefix, qname.name)) 738 qnames[qname] = encode("%s:%s" % (prefix, qname.name))
739 else: 739 else:
740 qnames[qname] = encode(qname.name) 740 qnames[qname] = encode(qname.name)
741 else: 741 else:
742 if default_namespace: 742 # XXX: What happens with undefined namespace?
743 # FIXME: can this be handled in XML 1.0?
744 raise ValueError(
745 "cannot use non-qualified names with "
746 "default_namespace option"
747 )
748 qnames[qname] = encode(qname.name) 743 qnames[qname] = encode(qname.name)
749 except TypeError: 744 except TypeError:
750 _raise_serialization_error(qname) 745 _raise_serialization_error(qname)
751 746
752 # populate qname and namespaces table 747 # populate qname and namespaces table