Click here to Skip to main content
15,881,764 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,
I am trying to extract the contents of ODT files for indexing.
Let me elaborate.

The following are the steps i follow to extract the contents of the odt file:

Steps
1 - convert the odt file into a temporary zip file.
2 - loop thru the files inside and retrieve the 'content.xml' file.
3 - the actual content of the ODT file resides in an xml element called <text:p>
4 - index the contents retrieved from <text:p>


I am having trouble in step 3.
I do not have the content.xml's schema. Only with the schema, i can generate the respective java classes of the elements.

Pls guide me
Posted
Updated 9-Mar-10 20:10pm
v5

And which part of your program are you having trouble with?
 
Share this answer
 
koolshiva wrote:
But it doesn't work.


Sorry, but that really does not help anyone to guess what might be wrong. Take a look at this article[^] for guidance on reading XML data.
 
Share this answer
 
Hey friends,

I have found an alternative. I am using SAX instead of JAXB now. I already had this option, but i personally preferred JAXB owing to performance.
 
Share this answer
 
I am using JAXB to extract from the 'content.xml' file in the odt. I am unable to get the XML Schema of the content.xml file. I tried generating it from the xml using hitsw site. But it doesn't work.
 
Share this answer
 
Comments
Sudhakar Shinde 28-May-13 2:17am    
You have to put this as a comment and not as an answer.
Sorry for not being specific. Let me elaborate.

The following are the steps i follow to extract the contents of the odt file:

Steps
1 - convert the odt file into a temporary zip file.
2 - loop thru the files inside and retrieve the 'content.xml' file.
3 - the actual content of the ODT file resides in an xml element called <text:p>
4 - index the contents retrieved from <text:p>>

I am having trouble in step 3.
I do not have the content.xml's schema. Only with the schema, i can generate the respective java classes of the elements.

Pls guide me
 
Share this answer
 
v2
Comments
Sudhakar Shinde 28-May-13 2:16am    
You have to put this as a comment and not as an answer.
could you share your source code for me? I have the same questions
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900