Adding user defined attributes to odt xml

Java, C++, C#, Delphi, ??? - Using the UNO bridges

Adding user defined attributes to odt xml

Postby virtualj » Wed May 14, 2008 9:26 pm

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.
virtualj
 
Posts: 1
Joined: Wed May 14, 2008 9:19 pm

Re: Adding user defined attributes to odt xml

Postby Villeroy » Wed May 14, 2008 9:54 pm

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.4
User avatar
Villeroy
Volunteer
 
Posts: 28440
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to External Programs

Who is online

Users browsing this forum: No registered users and 2 guests