ÍøÒ³´ÓxmlÎļþÖжÁÊý¾Ý
xmlÎļþÈçÏ£º<?xml version="1.0" encoding="gb2312"?>
<Èí¼þ¹ÜÀíϵͳ>
<¹ÜÀíÔ±>
<Óû§Ãû>Ã÷ÈտƼ¼</Óû§Ãû>
<ÃÜÂë>123456</ÃÜÂë>
<µØÖ·>³¤´ºÊÐ</µØÖ·>
</¹ÜÀíÔ±>
<¹ÜÀíÔ±>
<Óû§Ãû>Ã÷ÈÕÈí¼þ</Óû§Ãû>
<ÃÜÂë>789654</ÃÜÂë>
<µØÖ·>³¤´ºÊÐ</µØÖ·>
</¹ÜÀíÔ±>
</Èí¼þ¹ÜÀíϵͳ>
ÔÚbody²¿·ÖµÄ´úÂ룺
<xml id="xmlid" src="index.xml" mce_src="index.xml"> <!-- Á´½ÓXMLÎļþ -->
</xml>
<table datasrc="#xmlid" width="450" bgcolor="#CCCCFF" border="5" cellspacing="0" cellpadding="0">
<thead>
<td width="150" align="center" height="25"><span class="STYLE1">Óû§Ãû</span></td>
<td width="150" align="center" height="25"><span class="STYLE1">ÃÜÂë</span></td>
<td width="150" align="center" height="25"><span class="STYLE1">µØÖ·</span></td>
</thead>
<tr>
<td height="25" align="center" class="STYLE2"><SPAN datafld="Óû§Ãû"></SPAN></td>
<td height="25" align="center" class="STYLE2"><SPAN datafld="ÃÜÂë"></SPAN></td>
<td height="25" align="center" class="STYLE2"><SPAN datafld="µØÖ·"></SPAN></td>
</tr>
</table>
Ïà¹ØÎĵµ£º
XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......
ÔÚ¿ª·¢ÏµÍ³Ê±£¬ÎÒÃǾ³£»áʹÓõ½xmlÃèÊöµÄÎļþ£¬ÎÒÃÇ»ù±¾²ÉÓÃÈçϼ¸ÖÖ·½Ê½½øÐнâÎö£º
1dom
DOM ÊÇÓÃÓëÆ½Ì¨ºÍÓïÑÔÎ޹صķ½Ê½±íʾ XML ÎĵµµÄ¹Ù·½ W3C ±ê×¼¡£DOM ÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐѰÕÒÌØ¶¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó² ......
×î³£¼ûµÄXMLÊý¾ÝÀàÐÍÓУºElement, Attribute£¬Comment, Text.
Element, Ö¸ÐÎÈç<Name>Tom<Name>µÄ½Úµã¡£Ëü¿ÉÒÔ°üÀ¨£ºElement, Text, Comment, ProcessingInstruction, CDATA, and EntityReference.
Attribute, Ö¸ÔÚ<Employee id=”12345”>ÖеĴÖÌ岿·Ö¡£
......
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Syste ......
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Xml;
using System.Data;
public class Cls_XML
{
#region ´´½¨xmlÎļþ
/// <summary>
/// ´´½¨xmlÎļþ
/// ......