|
Main » 2012 » November » 02
XSLT is very simple but powerful way to handle dynamic transform. In
this example i have used XML datasource and XSLT file for generating
dynamic nested menu. The menu source is an SQL server database. The
script for generating SQL table is also provided with
solution. Download source code of dynamic
nested menu using XSLT
|
Create Excel (xls) from gridview, XSLT from XML using c#, ASP.NET or .NETIn this example i have covered 2 ways of generating XLS: 1. From Gridview 2. Using XLST file Code for Gridview to XLS:Download code for Gridview to ExcelCode for XLS using XSLT:Download code for generating excel using XSLTNote:- Better way is using XSLT.
- XSLT is fast resource for generating XSL
- Can be used with any datasource taking XML in between.
|
Generating HTML from XML, Database, Dataset
HTML from XML file source is generated, but you can use dataset to generate HTML from database by generating XML using dataset. In this example i have used XSLT file to transform XML to HTML file.
Download source code
Code: string source = Server.MapPath("~") + "//XMLFile.xml"; string style = Server.MapPath("~") + "//XSLTFile.xslt"; string destination = Server.MapPath("~") + "//a.html"; XslTransform transfor=new XslTransform(); transfor.Load(style); transfor.Transform(source,destination);
XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="htt
...
Read more »
|
Read html, text or content between HTML tag c#. .NETIt is very easy to read content between HTML tag using c#. Steps for reading HTML content are as follows: - Using namespace System.Xml
- Code:
XmlDocument a=new XmlDocument(); a.Load(Server.MapPath("~") + "//a.html"); XmlNode n = a.SelectSingleNode("/html/body"); TextBox1.Text = n.InnerXml; Note: - Be sure about case sensitivity of tag example (/HTML/BODY) in place of (/html/body).
Download source
| |
|
|
|