Group:  General ยป microsoft.public.office.xml
Thread: Convert XML to Word Document

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Convert XML to Word Document
"Alexander Bolotnov" <doph[ at ]yandex.ru> 02.12.2005 15:27:32
Hello everyone,

I created an XML file with Microsoft Word using a simple xsd schema. Then I
used wml2xslt tool to convert the xml file into an xslt seed document. Now,
with my C# application I can happily populate the xslt 'template' with
proper data I need. What I do is I take an xml that validates with the
original xsd the word xml was created with and trasform it with the xslt
file. The output file will contain proper data etc.

Can I convert, somehow, the output xml file to a .doc file, compatible with
older versions of Microsoft Word? Are there libs for that? Even C# maybe?

Thanks a lot,
Alexander.


Re: Convert XML to Word Document
"Hollis D. Paul" <Hollis[ at ]outhousebythesound.com> 02.12.2005 18:24:39
In article <439067e2$0$39913$892e7fe2[ at ]authen.yellow.readfreenews.net>,
Alexander Bolotnov wrote:
[Quoted Text]
> What I do is I take an xml that validates with the
> original xsd the word xml was created with and trasform it with the xslt
> file. The output file will contain proper data etc.
>
You want to do this using the Word Object model, so that the transformed
file is still a Word object. Then save that object as a .doc file.

Hollis D. Paul [MVP - Outlook]
Hollis[ at ]outhousebythesound.com
Mukilteo, WA USA


Re: Convert XML to Word Document
Cindy M -WordMVP- <C.Meister-C[ at ]hispeed.ch> 04.12.2005 11:36:00
Hi Alexander,

[Quoted Text]
> I created an XML file with Microsoft Word using a simple xsd schema. Then I
> used wml2xslt tool to convert the xml file into an xslt seed document. Now,
> with my C# application I can happily populate the xslt 'template' with
> proper data I need. What I do is I take an xml that validates with the
> original xsd the word xml was created with and trasform it with the xslt
> file. The output file will contain proper data etc.
>
> Can I convert, somehow, the output xml file to a .doc file, compatible with
> older versions of Microsoft Word? Are there libs for that? Even C# maybe?
>
No, you can't do that (yet, anyway) without automating Word and saving as a
Word document (*.doc). Older versions can't work with the XML format. With the
advent of O12, Microsoft has said it will supply converters for older
versions, so that all versions can deal with the Word 12 XML file format. But
that will be a while, yet.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net