How to Transform A DataSet using Xml and Xslt in .Net 2.0

// Creating DOM Document
XmlDocument doc = new XmlDocument();

// Get hold of the XML string from the dataset

//Load XSL and Tranform
XslCompiledTransform myXslTrans = new XslCompiledTransform();
string path = Directory.GetCurrentDirectory();
myXslTrans.Load(path + @”PrintView.xslt“);

// Using a StringWriter for Streaming part
StringWriter stringWriter = new StringWriter();

// The actual transformation
myXslTrans.Transform(doc.DocumentElement, null, stringWriter);

// Consuming the transformed results


Author: Pouya Panahy

Microsoft certified DevOps engineer with passion in analysing, designing and implementing solutions for Azure Cloud with hands-on experience in security and quality assurence.

Leave a Reply