RE: [xsl] XML document to WORD??

Subject: RE: [xsl] XML document to WORD??
From: "Richard Lander" <rlander@xxxxxxxxxxxxx>
Date: Tue, 15 Oct 2002 10:08:37 -0700
I've done this in the past.

It is actually surprisingly easy, as suggested below.

The basic approach is:
1. create the Word representation you want of some markup, in Word,
against your template if you are using a template other than
2. Save the document out as WordHTML
3. Figure out what is going on, then write the WordHTML coding to your
4. Run a transform against a sample document that would map to the
content in step 1
5. Open up resultant document in Word. If it doesn't work, then figure
out how to make it work
6. Repeat until you've mapped your doctype to Word.

1. Don't give up, thinking that you cannot make something to work. If
Word can rountrip certain content, then so can you
2. There is a significant amount of WordHTML that you won't have to
represent your template, as the template provides Word with the same
3. You may need to do some dirty work creating some non-wellformed
structures, such that you'll need to do things with xsl:text
4. Relying on styles within a template makes this task much easier
5. We did this work w/o any internal Word specs, but by simple
reverse-engineering Word. You can likely do the same.



-----Original Message-----
From: Wendell Piez [mailto:wapiez@xxxxxxxxxxxxxxxx] 
Sent: Monday, October 14, 2002 8:37 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx

It is surprisingly possible to reverse engineer Word's HTML/CSS 
export/import and derive a target for an XSLT transform. If done
enough, one can even get some styles in Word (which are wonderfully

It's a finicky job though, and pushes the edges when you get to things
headers and footers (though much is possible in theory). Yet dreadfully 
satisfying to "tame" Word. Don't expect to get the XML back though

I also like Joerg's other ideas.


At 08:00 PM 10/14/2002, Joerg wrote:
>Two more possibilities:
>- using MS Word XML format - I don't know anything about it, but it 
>exists. In the future there will be XDocs 
>- using an XML framework like Cocoon (, 
>serialize the output to RTF and open this with Word. So you don't need
>additional Java coding, only XSLT.

     "Thus I make my own use of the telegraph, without consulting
      the directors, like the sparrows, which I perceive use it
      extensively for a perch." -- Thoreau

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread