medusa
medusa

Reputation: 541

XSLT parsing XML to generate Word document

I have an XLST file that is supposed to parse an XML file and generate Word document. But when I parse it in Visual Studio it produces another XML because its header is:

<xsl:output method="xml" omit-xml-declaration="no" version="1.0" encoding="utf-8" standalone="yes" />
<xsl:template match="/">
    <xsl:processing-instruction name="mso-application">
        <xsl:text>progid="Word.Document"</xsl:text>
    </xsl:processing-instruction>

I tried the method= "text" but it generates a plain text with no formatting. what property should I specify so that when I run the transformation it saves the result in a Word document?

Upvotes: 0

Views: 3007

Answers (1)

Catch22
Catch22

Reputation: 3351

Another option might be to simply generate HTML (and specify the output method as HTML) and save the file with a .doc extension.

MS Word will open the file without complaining (though it still knows that it's a web page)

Upvotes: 1

Related Questions