简化我的问题
我的xml:
<a><b RANGE1="32,127", RANGE2="3,17", RANGE3="2,2", RANGE17="2,12",RANGE27="3,3" /></a>
我想添加属性范围10=“5,5”
我在下面使用了xml.etree.ElementTree python模块中的注释
element.set('RANGE10', '5,5')
它给人的感觉就像
<b RANGE1="32,127", RANGE10="5,5", RANGE17="2,12", RANGE2="3,17",RANGE27="3,3",RANGE3="2,2"/>
也就是说,它会自动按升序排列,类似于RANGE1、RANGE10、RANGE17、RANGE2、RANGE27、RANGE3
但我想在结尾追加我的输入,而不干扰现有的顺序,如下所示
<b RANGE1="32,127", RANGE2="3,17", RANGE3="2,2", RANGE17="2,12",RANGE27="3,3", RANGE10="5,5"/>
需要做什么?。谢谢
目前没有回答
相关问题 更多 >
编程相关推荐