f



read openOffice files with java?

Hi,

first of all, sorry if this is the wrong group, please redirect me to a 
more appropiate one.

Here's the problem: I have to read an openOffice text document in Java, and 
convert it to a regular xml-document. I have heard that openOffice uses xml 
for it's internal structure, but I'm not quite sure. Anyway's, I've tried 
to open such a document, in a regular editor (notepad) and in a hex editor 
(ultra editor) but none of them can reveal more about the internal 
structure. Is there a way to let java read directly from such a file?

Thanks in advance.
<T!M> aka wEEdpEckEr
0
4/27/2004 10:59:27 PM
comp.lang.java.softwaretools 2938 articles. 1 followers. Post Follow

3 Replies
409 Views

Similar Articles

[PageSpeed] 6

wEEdpEckEr wrote:

> Hi,
> 
> first of all, sorry if this is the wrong group, please redirect me to a
> more appropiate one.
> 
> Here's the problem: I have to read an openOffice text document in Java,
> and convert it to a regular xml-document. I have heard that openOffice
> uses xml for it's internal structure, but I'm not quite sure. Anyway's,
> I've tried to open such a document, in a regular editor (notepad) and in a
> hex editor (ultra editor) but none of them can reveal more about the
> internal structure.

That's because .sxw files are zip files which have the .xml files inside.

> Is there a way to let java read directly from such a file?

Use the java.util.zip.ZipFile class which comes with the JDK to access
the .sxw contents and then use an XML parser...

I think OpenOffice has a Java API for working with its files but I have no
experience in that so I cannot be of any help but you should try looking
for that first.

Greetings,

Crazy Photon

-- 
Resistance is NEVER futile... except for you!
0
hquartin (3)
4/28/2004 3:23:44 AM
> I think OpenOffice has a Java API for working with its files but I have no
> experience in that so I cannot be of any help but you should try looking
> for that first.

See http://api.openoffice.org, this should help in your task.

HTH,

Crazy Photon

-- 
Resistance is NEVER futile... except for you!
0
hquartin (3)
4/28/2004 3:30:18 AM
Crazy Photon <hquartin@hotmail.com> schreef op wo, 28 apr 2004 03:30:18 GMT 
in news:c6n8gb$ddmno$1@ID-132083.news.uni-berlin.de:

> See http://api.openoffice.org, this should help in your task.

Thanks for the information, I will surely take a look at it.

greetings
<T!M> aka wEEdpEckEr
0
4/28/2004 6:23:42 PM
Reply: