0

我想用python替换<category/>关闭Passenger cars </category> 。我只需要在类别打开和关闭 xml 标记之间添加“乘用车”

        categories=xml.getElementsByTagName('category')[0].toxml()
        if categories=='<category/>':
            categories=categories.replace('<category/>','<category>Passenger cars</category>')
4

0 回答 0