?
Solved

Translate XML to MS Word format (.doc)

Posted on 2002-03-25
11
Medium Priority
?
573 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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
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 200 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 200 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

TCP/IP Network Protocol Cheat Sheet

TCP/IP is a set of network protocols which is best known for connecting the machines that make up the Internet. The truth is that TCP/IP is one of the oldest network protocols and its survival is mainly based on its simplicity and universality.

Question has a verified solution.

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

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

801 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