Show XML Content Using XSLT Using C#
XmlDocument docXML = new XmlDocument();
XslTransform docXSL = new XslTransform();
docXML.Load(Server.MapPath("sample1.xml"));
docXSL.Load(Server.MapPath("sample1.xslt"));
Xml1.Document = docXML;
Xml1.Transform = docXSL;
Please find the attached "sample.xml" and "sample.xslt" files.
above code will first load the xml document and then apply the xtensible style sheet on that document.
Output of the above code will be like this:
Author: Lakhan Pal Garg
Email ID:lakhangarg@gmail.com
Blog:http://www.lakhangarg.blogspot.com
Headings will be in bold.
