PDA

View Full Version : Major_Disorder


motupal
12-14-2003, 02:20 AM
This is a question for the Major Disoder, I saw your thread where you had suggested Allan to create a Word 2003 Document through the combination of XML / XSLT to get the word document. I am a beginner with XML / XSLT tech, so please give me the sample code to merge the XML and XSLT to get the word 2003 Document.

I have done all what you have suggested in the previous thread to ALLAN.

1. I have create the word 2003 doc with all the styles add the schemea to the doc and some test data, and saved the doc as .xml file.

2. I have also downloaded the XMP SPY.

Now I just need the code to transform the XML / XSLT to get the word 2003 document.

Thanks for your help


Regards,
motupal

Major_Disorder
12-14-2003, 11:41 AM
Hi Motupla

Here's the basics to get you going with a transform from one XML format to another. Just make sure that your XSL(T) transforms your source XML to your Word Doument format correctly and your should be off. Don't know if this is really what you want. Check out google for lots of other examples too..

Pete

Imports System.Xml
Imports System.Xml.Xsl

Function Code

Dim xslt As New XslTransform()

Try
xslt.Load("transform.xslt")
xslt.Transform("source.xml", "result.xml")

Catch ex As Xsl.XsltException
Console.WriteLine("Transform Failed")
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try



XBOXRacing.net

Tournaments, Leagues & Prizes