File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1119,6 +1119,11 @@ def qname():
11191119 >>> elem = ET.Element(ET.QName("uri", "tag"))
11201120 >>> serialize(elem) # 1.3
11211121 '<ns0:tag xmlns:ns0="uri" />'
1122+ >>> elem = ET.Element(ET.QName("uri", "tag"))
1123+ >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag1"))
1124+ >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag2"))
1125+ >>> serialize(elem) # 1.4
1126+ '<ns0:tag xmlns:ns0="uri"><ns0:tag1 /><ns0:tag2 /></ns0:tag>'
11221127
11231128 2) decorated attributes
11241129
Original file line number Diff line number Diff line change @@ -913,8 +913,9 @@ def add_qname(qname):
913913 iterate = elem .getiterator # cET compatibility
914914 for elem in iterate ():
915915 tag = elem .tag
916- if isinstance (tag , QName ) and tag .text not in qnames :
917- add_qname (tag .text )
916+ if isinstance (tag , QName ):
917+ if tag .text not in qnames :
918+ add_qname (tag .text )
918919 elif isinstance (tag , str ):
919920 if tag not in qnames :
920921 add_qname (tag )
You can’t perform that action at this time.
0 commit comments