【C#】XSLT转换XML实例
产品几年前使用ASP,后来升级到.Net 1.1,再升级到2.0,一直都有用XSLT转换XML生成网页的方式,稍微整理下。
XML file:
<?xml version="1.0" encoding="utf-8" ?>
<ric>
<catalog>
<book price="75">
<author>Kalen Delaney</author>
<name>Inside SQL Server 2000</name>
</book>
<book price="200">
<author>Ken Henderson</author>
<name>The Guru's Guide to SQL Server Architecture</name>
</book>
</catalog>
</ric>
XSLT file:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="/">
<html>
<body>
<table cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse;font-size:14px;">
<tr>
<th>Book Name</th>
<th>Author</th>
<th>Price</th>
</tr>
&nb
相关文档:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
private XmlDo ......
利用sqlhelper中的ExcuteXmlReader方法,读取数据并保存为xml文件
string strConn = Properties.Settings.Default.Connections;
SqlConnection connection = new SqlConnection(strConn);
& ......
一、Access从Excel中导入数据
1.用到的Excel表的格式及内容
实现
OleDbConnection con = new OleDbConnection();
try
{
OpenFileDialog openFile = new OpenFileDialog();//打开文件对话框。
openFile.Filter = ("Excel 文件(*.xls)|*.xls") ......