List Info

Thread: odf4j and ODT documents




odf4j and ODT documents
user name
2007-03-30 04:58:12
Hi,

I need something to allow me to manipulate ODT files in
java. I found this
great project and already downloaded the code, but if
someone could tell me
what are the main capabilities in terms of ODT documents I
would really
appreciate. I've already went through the code and I think
that in this
moment the most advanced part of the project is the
manipulation of the
archive file itself and there is a little bit of ODS
creation fixtures. No
ODT specific things...

Right now, can I read, search, edit and re-save ODT
documents?

Regards,
Nuno
Re: odf4j and ODT documents
user name
2007-03-30 05:52:51
Nuno Rocha wrote:
> Hi,
> 
Hi Nuno,

> I need something to allow me to manipulate ODT files in
java. I found this
> great project and already downloaded the code, but if
someone could tell me
> what are the main capabilities in terms of ODT
documents I would really
> appreciate. I've already went through the code and I
think that in this
> moment the most advanced part of the project is the
manipulation of the
> archive file itself and there is a little bit of ODS
creation fixtures. No
> ODT specific things...

You are right for text documents there´s currently not much
there.
Contributions are welcome 

> 
> Right now, can I read, search, edit and re-save ODT
documents?
> 

read:

TextDocument
txtdoc=(TextDocument)OpenDocumentFactory.load(file);

searching and changing:

org.w3c.dom.Document
content=txtdoc.getDocument("content.xml")
org.w3c.dom.Document
styles=txtdoc.getDocument("styles.xml")

and than you can manipulate or search on the DOM trees.

save:

txtdoc.save("test.odt");

Another method of manipulating txt files available is using

XSL-Transformations you can use the OdfXMLHelper class for
applying such.

> Regards,
> Nuno
> 

Regards,
Bernd Eilers

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeodftoolkit.openoffice.org
For additional commands, e-mail: dev-helpodftoolkit.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )