¡¾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
Ïà¹ØÎĵµ£º
1 using System;
2 using System.Collections;
3 using System.Configuration;
4 using System.Data;
5 using System.Linq;
6 using System.Web;
7 using System.Web.Security;
8 using&nbs ......
ÀûÓÃsqlhelperÖеÄExcuteXmlReader·½·¨£¬¶ÁÈ¡Êý¾Ý²¢±£´æΪxmlÎļþ
string strConn = Properties.Settings.Default.Connections;
SqlConnection connection = new SqlConnection(strConn);
& ......
/*
* XMLTool.h ÅäÖÃÎļþ½âÎö¶¯Ì¬¿âÍ·Îļþ
* Ö÷ÒªÊä³öº¯Êý½Ó¿Ú·Ö±ðʵÏÖ¶ÔÅäÖÃÎļþµÄ¶ÁÈ¡ºÍдÈ룬Õë¶Ô½á¹û¼¯µÄ¸´ÖÆÇå¿Õ£¬ºÍÁ½¸ö×Ö·û´®´¦Àíº¯Êý
* ¶ÁÈ¡ÅäÖÃÎļþ½Ó¿Ú £ºint ReadXMLFile(XML_Node_Vector *XmlNodeVector, string filepath);
* дÈëÅäÖ ......
ÓÉÓÚÏîÄ¿ÐèÒª£¬Óõ½ÆäËûÏîÄ¿×éÓÃVC¿ª·¢µÄ×é¼þ£¬ÔÚwebºǫ́´úÂëÎÞ·¨·ÃÎÊÕâ¸ö×é¼þ£¬ËùÒÔÖ»ºÃͨ¹ýºǫ́µ÷ÓÃǰ̨µÄjavascript£¬´Ó¶ø²Ù×÷Õâ¸ö×é¼þ¡£ÔÚÍøÉÏÕÒÁËÕÒ£¬·¢ÏÖÓÐÈýÖÖ·½·¨¿ÉÒÔ·ÃÎʵ½Ç°Ì¨´úÂ룺
µÚÒ»ÖÖ£¬OnClientClick (vs2003²»Ö§³ÖÕâ¸ö·½·¨)
<asp:Button ID="Button1" runat="se ......