¡¾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
Ïà¹ØÎĵµ£º
Ê×ÏÈ,ÎÒÃDZØÐëÁ˽âʲôÊÇwebservice.¾Í¸ÅÄîÉÏÀ´Ëµ,¿ÉÄܱȽϸ´ÔÓ,²»¹ýÎÒÃÇ¿ÉÒÔÓиöºê¹ÛµÄÁ˽â:webservice¾ÍÊǸö¶ÔÍâµÄ½Ó¿Ú,ÀïÃæÓÐ º¯Êý¿É¹©Íⲿ¿Í»§µ÷ÓÃ(×¢Òâ:ÀïÃæͬÑùÓпͻ§²»¿Éµ÷Óõĺ¯Êý).¼ÙÈôÎÒÃÇÊÇ·þÎñ¶Ë,ÎÒÃÇдºÃÁ˸öwebservice,È»ºó°ÑËü¸øÁË¿Í»§(ͬʱÎÒÃǸøÁËËû Ãǵ÷ÓùæÔò),¿Í»§¾Í¿ÉÒÔÔÚ´Ó·þÎñ¶Ë»ñÈ¡ÐÅϢʱ´¦ÓÚÒ»¸öÏ ......
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 ......
/*
* XMLTool.cpp ÅäÖÃÎļþ½âÎö¶¯Ì¬¿â×ÊÔ´Îļþ
* Ö÷ÒªÊä³öº¯Êý½Ó¿Ú·Ö±ðʵÏÖ¶ÔÅäÖÃÎļþµÄ¶ÁÈ¡ºÍдÈ룬Õë¶Ô½á¹û¼¯µÄ¸´ÖÆÇå¿Õ£¬ºÍÁ½¸ö×Ö·û´®´¦Àíº¯Êý
* ¶ÁÈ¡ÅäÖÃÎļþ½Ó¿Ú £ºint ReadXMLFile(XML_Node_Vector *XmlNodeVector, string filepath);
* Ð´È ......
XML(eXtensible Markup Language)ÊÇÍòάÍøÁªÃË(World Wide Web Consortium W3C)¶¨ÒåµÄÒ»ÖÖ¿ÉÀ©Õ¹±êÖ¾ÓïÑÔ¡£
¿ÉÀ©Õ¹ÐÔÖ¸ÔÊÐíÓû§°´ÕÕXML¹æÔò×Ô¶¨Òå±ê¼Ç(tags ±êÇ©)¡£
Ç¿ÏÇáËɱí´ï¶à²ã½á¹¹µÄÊý¾Ý£»¿ÉÀ©Õ¹¡£
Óŵ㣺ƽ̨Î޹أ¬ÓïÑÔÎ޹ء£Éè¼ÆÄ¿±êÊÇÃèÊöÊý¾Ý²¢¼¯ÖÐÓÚÊý¾ÝµÄÄÚÈÝ£¬ÓëÏÔʾ·ÖÀë¡£
ÌáÐÑ£º² ......
protected void Page_Load(object sender, EventArgs e)
{
lblValue.Text = string.Format("{0:N}", 2500000);
lblValue.Text = string.Format("{0:C3}", 2);
......