We are currently working on a java project to add concurrency control and locking for odt documents to open office.
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.
Adding user defined attributes to odt xml
Re: Adding user defined attributes to odt xml
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice