jQuery in Action, 3rd edition
The moose likes XML and Related Technologies and the fly likes Convert Word to XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Convert Word to XML" Watch "Convert Word to XML" New topic

Convert Word to XML

Rajan Thiyagarajan
Ranch Hand

Joined: Dec 12, 2002
Posts: 61
I need to convert a word document(which follows a standard template) into an XML document. Right now I am doing it manually by inserting the defined set of XML tags. Is there a way to automate this process of inserting XML tags based on the WORD template. Is there any tool available in market. Or we need to write a program(like in C or C#) to accomplish this. Any suggestion, welcome.
I have a general XSL which will be used to all XML documents(converted from word). Our final aim is to come up with a knowledge management system, with search capabilities, discussion forums etc.

- IBM Certified - eBusiness Solution Technologist
- IBM Certified Developer - XML
- Microsoft Certified Application Developer
- Tibco Certified Professional
- Sun Certified Java Professional

Perseverance can make miracles happen
ib idris

Joined: Aug 02, 2003
Posts: 29
I am not sure about the.doc format, but there is a free java package out there for RTF.
[ September 18, 2003: Message edited by: ib idris ]
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5376

"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Moved to the XML forum.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Geoff Oakham is writing a tool called doc2xml, which converts .doc files into XML. There are also some Windows/Office products/plugins for converting .doc files into XML as well. Google will help with those.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13018
You could download the OpenOffice package of applications. OO has been able to open every Word document I have thrown at it, and it can then save the file in various formats including XML.
I have also done this sort of conversion by saving the file from Word as text (with character replacement allowed to fix those accursed "smart" quotes) - If the template has been followed correctly, a Java program to reformat the text can be pretty simple.
sunitha reghu
Ranch Hand

Joined: Dec 12, 2002
Posts: 937
check this ...
Rajan Thiyagarajan
Ranch Hand

Joined: Dec 12, 2002
Posts: 61
Thanks for everyone's suggestions. I have not looked into the suggested tools/websites. Will let you know the results afterwards.
I tried with XML Spy. It has a facility to take a Word document as input and convert it to an XML document. The problem being, the converted XML is not WELL FORMED always.
I am interested in a tool which will convert based on the XSD I have. Bit tough, but somewhere there should be one. The search continues.
[ September 18, 2003: Message edited by: Rajan Thiyagarajan ]
I agree. Here's the link: http://aspose.com/file-tools
subject: Convert Word to XML
It's not a secret anymore!