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.


Attachments

  • Sample Files (28176-4259-sample1.zip)
  • Comments

    No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: