We Recommend

Accelerated C# 2008 Accelerated C# 2008
This book is both a rapid tutorial and a permanent reference. You’ll quickly master C# syntax while learning how the CLR simplifies many programming tasks. You’ll also learn best practices that ensure your code will be efficient, reusable, and robust. Why spend months or years discovering the best ways to design and code C# when this book will show you how to do things the right way, right from the start?


Posted By

LeeRJohnson on 11/28/07


Tagged

xslt xml XSL aspnet transform WebControl


Versions (?)


ASP XML Web Control Content By URL


Published in: C# 


This is an old quick and dirty way to read and transform feeds and HTML content.
The good part is if update your code the XML/HTML and the XSLT will be the same.


  1. //script
  2. XmlDocument xdocUrl = new XmlDocument();
  3. //Read URL into new XmlDocument
  4. xdocUrl.Load("http://www.domain.com/content.xml");
  5. xmlCtrl.DocumentContent = xdocUrl.InnerXml;
  6. //Load XSLT for formating
  7. xmlCtrl.TransformSource = "~/template.xslt";
  8.  
  9. //page tag
  10. <asp:Xml ID="xmlCtrl" runat="server"></asp:Xml>

Report this snippet 

You need to login to post a comment.