blob: 63f503b866b2634b66c2a414596d191fc317914f [file] [log] [blame]
lora-sp09a58a02023-03-10 16:33:46 +01001import sys
2import xml.etree.ElementTree as ET
3from lxml import etree
4from io import StringIO
5
6'''
7for i in range(1, len(sys.argv)):
8 print("file: " + str(i) + " " + sys.argv[i])
9 try:
10 ("normaler parse geklappt")
11 parser = etree.XMLParser(recover=False)
12 tree = ET.parse(sys.argv[i], parser)
13 #tree = ET.parse(sys.argv[i])
14 root = tree.getroot()
15 print(root.tag)
16 except:
17 print("nö")
18 #with open
19'''
20
21parser = etree.XMLParser(recover=True)
22tree = ET.parse("dnevnik.bg - 2020-01-02.xml", parser)
23ET.register_namespace("", "http://www.tei-c.org/ns/1.0")
24tree.write("outputTEST.xml", encoding='utf-8', xml_declaration=True, method='xml', short_empty_elements=True)
25
26