Solved

Translate XML to MS Word format (.doc)

Posted on 2002-03-25
11
552 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
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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Grunt No Clean Targets 6 54
PHP and Soap 3 27
Scraping specific data within an XML document 19 45
XML & .net 5 16
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to count occurrences of each item in an array.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now