Created on 2017-10-04 15:20 by ced, last changed 2017-10-04 15:20 by ced.
|msg55||Author: [hidden] (ced)||Date: 2017-10-04 15:20|
When reading the code of py3o, I found this . So the problem is that some tag  (like the 'text:list') of ODF may have 'xml:id' attribute which must be unique for a valid XML. The problem with the solution of py3o is that it breaks all references inside the document, like the value of the attribute 'text:continue-list' . A proper way to manage this case is by adding on element with 'xml:id' an 'attr' directive that will update the id and any references inside the loop. But it would be great to have this behavior automatically managed by the loop. A possible solution would be inside a loop find all the 'xml:id' and replace them by a Genshi expression that will generate a new one on each iteration and also replace all attributes that would refer to the 'xml:id' by the same new value. The first iteration should keep the same 'xml:id' in case they are used as reference from outside the loop.  https://bitbucket.org/faide/py3o.template/src/d43e3a95ba41ca90ba80e48744b2da1079cc5989/py3o/template/main.py?at=default&fileviewer=file-view-default#main.py-146  http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-xml_id  http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415148_253892949  http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-text_continue-list