Bug 37

Title: xml:id inside loop
Type: rfe Severity: normal
Components: opendocument Versions:
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.

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.

Date User Action Args
2017-10-04 15:20:21cedcreate