You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import ezodf as ods
file = r'example_file.ods'
for x in range(2, 6):
print(x)
ODS = ods.opendoc(file)
per1 = ODS.sheets['perimetro_1'] #the example file has a sheet called 'perimetro_1'
duplicate = per1.copy(newname='perimetro_{0}'.format(x))
ODS.sheets += duplicate
ODS.save()
when trying to duplicate for the second time, this error occurs:
Traceback (most recent call last):
File "e:\Trabalho\Repos\Geoja\Gra\SGT\teste.py", line 7, in <module>
ODS = ods.opendoc(file)
File "C:\Program Files\Python37\lib\site-packages\ezodf\document.py", line 54, in opendoc
return PackagedDocument(filemanager=fm, mimetype=mime_type)
File "C:\Program Files\Python37\lib\site-packages\ezodf\document.py", line 226, in __init__
self.content = OfficeDocumentContent(mimetype, fm.get_xml_element('content.xml'))
File "C:\Program Files\Python37\lib\site-packages\ezodf\filemanager.py", line 136, in get_xml_element
return etree.XML(filecontent)
File "src\lxml\etree.pyx", line 3216, in lxml.etree.XML
File "src\lxml\parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
File "src\lxml\parser.pxi", line 1784, in lxml.etree._parseDoc
File "src\lxml\parser.pxi", line 1141, in lxml.etree._BaseParser._parseDoc
File "src\lxml\parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
File "src\lxml\parser.pxi", line 725, in lxml.etree._handleParseResult
File "src\lxml\parser.pxi", line 654, in lxml.etree._raiseParseError
File "<string>", line 2
lxml.etree.XMLSyntaxError: ID control9 already defined, line 2, column 1190729
The text was updated successfully, but these errors were encountered:
Here's my code example
when trying to duplicate for the second time, this error occurs:
The text was updated successfully, but these errors were encountered: