Relatorio

Bug 37

classification
Title: xml:id inside loop
Type: rfe Severity: normal
Components: opendocument Versions:
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ced
Priority: low Keywords:

Created on 2017-10-04 15:20 by ced, last changed 2017-10-04 15:20 by ced.

Messages
msg55 Author: [hidden] (ced) Date: 2017-10-04 15:20
When reading the code of py3o, I found this [1]. So the
problem is that some tag [2] (like the 'text:list'[3]) 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' [4].
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.


[1]
https://bitbucket.org/faide/py3o.template/src/d43e3a95ba41ca90ba80e48744b2da1079cc5989/py3o/template/main.py?at=default&fileviewer=file-view-default#main.py-146
[2]
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-xml_id
[3]
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415148_253892949
[4]
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#attribute-text_continue-list
History
Date User Action Args
2017-10-04 15:20:21cedcreate