Solved

Translate XML to MS Word format (.doc)

Posted on 2002-03-25
11
564 Views
Last Modified: 2013-11-19
Hi, all.

Is there any way to transalate a XML document to a MS Word document format (.doc)?

Is there any translation method similar to create PDFs using xsl:FO?

My XML documents contains a tag set which represents bold, italics... and I need to create a .doc with a similar format.

TIA

Carlos
0
Comment
Question by:carlos0007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 23

Expert Comment

by:b1xml2
ID: 6895720
The first issue as always is what version of Word, is it Word 2000, Word 6, Word 97, Word 2002.

Points to note
==============
1. Word 2002 has superior xml support than Word 2000
2. Word 2000 can load HTML documents and save the document as a Word Document (using VBA)

Further points to note
======================
1. XML Documents are not for display purposes. They hold data that have relationships, so technically, there is really no possibility of translating XML documents to Word simply because it is not the way to do it. Presentation rules should not exist
0
 
LVL 27

Expert Comment

by:BigRat
ID: 6896074
I must disagree with b1xml2. An XML document can be considered as a poor relation to an SGML document. The latter of course often gets translated to text based file formats; for techincal manuals and so on. So I disagree that "there is really no possibility of translating XML documents to Word".

I know of no tool which translates to Word, but I would suggest that you get yourself a RichTextFormat manual and have a look at that. You could start at RatFink (http://www.flightlab.com/cost/ratfink/ratfink.html) which is actually a Tcl library for RTF but at least it would be a start.

You find it rather difficult to go directly from XML to RTF and it might be worthwhile looking at an XSL:FO to RTF transform as something easier.
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 6896083
BigRat, I must disagree with you. Using XSLT can transform XML to some extent to HTML Format that Word can load and save as a *.doc. However, he is suggesting converting XML straight to Word.

What I have said is in regard to:
>>My XML documents contains a tag set which represents bold, italics... and I need to create a .doc with
a similar format.
<< and take it that he wants to convert XML straight to Word and that is where the context is.

>>
I know of no tool which translates to Word, but I would suggest that you get yourself a RichTextFormat
manual and have a look at that. You could start at RatFink (http://www.flightlab.com/cost/ratfink/ratfink.html) which is actually a Tcl library for RTF
but at least it would be a start.
<<

ensures what I have said:
"there is really no possibility of translating XML documents to Word" is true.

You are not saying anything new.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:b1xml2
ID: 6896084
RTF is not .doc.
0
 
LVL 1

Expert Comment

by:janegil
ID: 6896447
Staroffice 6 beta can, in a very messy sort of way.

But you'd have to write one or more XSLTs to convert your XML format to StarOffice's, zip several XML files together, rename the zip file, open it in AtarOffice and save as Word file.

So no, that's too messy. Maybe if StarOffice cleans up their act: saves a document in ONE xml file, and makes zipping an option.
0
 

Author Comment

by:carlos0007
ID: 6896717
I will try to focus on the main question:

I know tools to translate from XML to PDF: Translate XML to FO and after FO to PDF. OK?

I ask you: exists any similar tool to translate a XML document to .doc format?

We are a developer team: we want make an application for the clients to obtain the text in Word format.
We have a Oracle database with texts in XML and we give actually these texts in HTML format to the users, using XSLT.

Could we present this XML texts also in Word (.doc) format?

Carlos
0
 
LVL 15

Accepted Solution

by:
robbert earned 50 total points
ID: 6897975
There are no Word renderers (other than Word), like there are PDF renderers, from XSL:FO.
Also, I didn't found external applications (like a Word plugin) to import XML to Word - at least, nothing comfortable or serious.

- You would create placeholder fields in Word templates, loop through them, and replace their name/value by the XML node/attribute value which you identify by the Word fields names/values (the placeholder fields may also contain XPath statements or other commands which you would interprete).

http://www.braem17.yucom.be/xml2word.htm

Note: In the above link, the author states his technique was out-of-date. This is true for how he is implementing details, but his overall idea is still the only way to get this to work.
We've been through this, and our solution was quite similar.
0
 
LVL 27

Assisted Solution

by:BigRat
BigRat earned 50 total points
ID: 6909174
robberts link is very interesting. May I ask, Carlos, where the XML to "Word" rendering is to take place?

The XML to HTML rendering can take place on the server, to be delivered to the browser, or actually in the browser. In the case of .doc where should this take place?
0
 
LVL 9

Expert Comment

by:sparkplug
ID: 8730746
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[Split points between BigRat and robbert.]
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

>S'Plug<
EE Cleanup Volunteer
0
 
LVL 1

Expert Comment

by:Sparky191
ID: 13120524
Carlos - Was wondering what solution did you end up with.

I'm looking at XML>(XSL-FO)>RTF from VB.NET/ASP.NET
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question