Код: Выделить всё
Код: Выделить всё
import xml.etree.ElementTree as ET
ET.register_namespace("", "http://www.w3.org/2000/svg")
tree = ET.parse('test.svg')
tree.getroot().set("xmlns:xlink", "http://www.w3.org/1999/xlink")
link = ET.fromstring('[url=http://www.example.com/][/url]')
tree.write('worldMap/test_out.svg', encoding = 'utf-8', xml_declaration = True)
Подробнее здесь: https://stackoverflow.com/questions/167 ... lementtree