Created
November 1, 2010 22:43
-
-
Save ahall/659011 to your computer and use it in GitHub Desktop.
TransformXslt.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Transform(Stream xmlDoc, string sXslPath, Stream outStream) | |
{ | |
//load the Xml doc | |
XPathDocument myXPathDoc = new XPathDocument(xmlDoc); | |
XslTransform myXslTrans = new XslTransform(); | |
//load the Xsl | |
myXslTrans.Load(sXslPath) ; | |
//create the output stream | |
using (XmlTextWriter myWriter = new XmlTextWriter(outStream, null)) | |
{ | |
//do the actual transform of Xml | |
myXslTrans.Transform(myXPathDoc,null, myWriter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment