But we are stuck on the problem of adding identifiers to elements in the odt xml representation.
Is there a way to use the api (java) to add an identifier attribute to, for example, a paragraph?
example: <text:p text:style-name="Text_20_body" text:my_id="123">This is a paragraph</text:p>
We have tried several approaches but there seems to be no good way to add your own attributes in the content.xml.
We have tried:
- We extracted the odt file and manually added an attribute to the content.xml file. But when you open and edit the odt file the attribute is removed.
- using metadata to keep the id, but the metadata can not be added to the different elements?
- I know there exists a UserDefinedAttributes but couldn't get it to work. Is it possible to use this to set and read the attributes?
- I tried to use the code from http://api.openoffice.org/servlets/Read ... sgNo=13957 but I couldn't get it to add the attributes to the right paragraph. And I did not find a way to read the data from the attributes with the api.
| Edit: 2024-05-09: Broken link -- MrProgrammer, forum moderator |