views:

21

answers:

2

Is there an easy way to automatically convert a bunch of MS Word documents to xslt stylesheets that can be displayed in the browser?

What I have is a large collection of forms in Word format that have to be displayed in the browser, or sent to the user, with known fields populated from a data source, edited by a user and, finally, printed (including the original headers and footers). The data entered by the user will not need to be saved.

I'm not sure if converting the documents to stylesheets is even feasible. Maybe someone has a better idea of how to achieve this? Installing Office on the server is not an option in my case.

+1  A: 

If you are working with .docx, I would have a look into Word-ML. Docx files are basically a collection of XML files zipped together.

Meiscooldude
Thanks, that's exactly what I needed! After researching .docx I found a .NET library on codeplex called DocX which enables the manipulation of .docx files.
Chris Johnson
A: 

I have experimented with using the "Flat OPC package format" to represent the docx as a single XML file, which is then displayed using XSLT.

But ultimately, I prefer to convert the docx to HTML with CSS. docx4j (Java) makes a point of producing clean CSS.

plutext