C#ʵÏÖXMLϵÁл¯ºÍ·´ÏµÁл¯µÄ×ܽá
³£ÓõÄϵÁл¯¶¨Ò壨using System.Xml.Serialization;£©
[XmlAttribute("name")] // ¶¨Òå<Tag name="…"></Tag>
[XmlElement("label")] // ¶¨Òå<label>…</label>
[XmlIgnoreAttribute()] // Ìø¹ýϵÁл¯
[XmlElement("description", IsNullable = false)] // ¶¨Òå<description>…</description>£¬ÔÚÊôÐÔֵΪnullʱ²»ÏÔʾ¸ÃÔªËØ£¬¼´¿ÉÑ¡
[XmlArray("temp_var_list", IsNullable=false)] // ¶¨Òå<temp_var_list><Tag>…</Tag>…<Tag>…</Tag></temp_var_list>£¬¼´Êý×é¶ÔÏóµÄ¸ù½áµã
[XmlArrayItem("temp_var_item")] // ¶¨Òå<temp_var_item>…</temp_var_item>…<temp_var_item>…</temp_var_item>£¬¼´Êý¾ÝÔªËصĸù½áµã£¬³£ÓëXmlArray×éºÏʹÓÃ
[XmlRoot("dpd")] // ¶¨ÒåÒª½áµã
¼¸¸ö×¢ÒâÊÂÏî
£¨1£©ÐèÐòÁл¯µÄ×ֶαØÐëÊǹ«¹²µÄ(public)
£¨2£©ÐèÒªÐòÁл¯µÄÀ඼±ØÐëÓÐÒ»¸öÎ޲εĹ¹Ô캯Êý
£¨3£©Ã¶¾Ù±äÁ¿¿ÉÐòÁл¯Îª×Ö·û´®£¬ÎÞÐèÓÃ[XmlInclude]
£¨4£©µ¼³ö·Ç»ù±¾ÀàÐͶÔÏ󣬶¼±ØÐëÓÃ[XmlInclude]ÊÂÏÈÉùÃ÷¡£¸Ã¹æÔòµÝ¹é×÷Óõ½×ÓÔªËØ
Èçµ¼³öArrayList¶ÔÏó£¬ÈôÆä³ÉÔ±ÊÇ×Ô¶¨ÒåµÄ£¬ÐèÔ¤°üº¬´¦Àí£º
using System.Xml.Serialization;
[XmlInclude(typeof(×Ô¶¨ÒåÀà))]
£¨5£©AttributeÖеÄIsNullable²ÎÊýÈôµÈÓÚfalse£¬±íʾÈôÔªËØΪnullÔò²»ÏÔʾ¸ÃÔªËØ¡£
Ò²¾ÍÊÇ˵£ºÕë¶ÔÖµÀàÐÍ£¨Èç½á¹¹Ì壩¸Ã¹¦ÄÜÊÇʵЧµÄ
ÈôÊý×é°üº¬ÁË100¸ö¿Õ¼ä£¬Ìî³äÁË10¸öÀà¶ÔÏó£¬ÔòÐòÁл¯ºóÖ»ÏÔʾ10¸ö½Úµã
ÈôÊý×é°üº¬ÁË100¸ö¿Õ¼ä£¬Ìî³äÁË10¸ö½á¹¹Ìå¶ÔÏó£¬ÔòÐòÁл¯ºó»áÏÔʾ100¸ö½Úµã
£¨6£©ÕæÕýÎÞ·¨XMLÐòÁл¯µÄÇé¿ö
ijЩÀà¾ÍÊÇÎÞ·¨XMLÐòÁл¯µÄ£¨¼´Ê¹Ê¹ÓÃÁË[XmlInclude]£©
IDictionary£¨ÈçHashTable£©
System.Drawing.Color
System.Drawing.Font
SecurityAttributeÉùÃ÷
&
Ïà¹ØÎĵµ£º
kXMLÊÇÒ»¸öJ2MEƽ̨ÏÂʹÓõÄXMLÓï·¨·ÖÎö³ÌÐò£¬¶ÔÓÚJ2MEÓ¦ÓóÌÐò·Ç³£Êʺϡ£ËüÓÐÒ»¸ö·Ç³£¶ÀÌصÄDOM²Ù×÷·½·¨ºÍ±»³ÆΪPullµÄÓï·¨·ÖÎö·½·¨¡£ËüÓÐÒÔÏÂÌØÐÔ£º
· Ö§³ÖXMLÃû³Æ¿Õ¼ä ¡¡¡¡
· ÓÃ"ËÉÉ¢"ģʽ·ÖÎöHTML»òÆäËüSGML¸ñʽ ¡¡¡¡
· Õ¼ÓúÜÉٵĴ洢¿Õ¼ä£¨21 kbps£© ¡¡¡¡
· »ùÓÚPullµÄ·ÖÎö ¡¡¡¡
......
protected void Page_Load(object sender, EventArgs e)
{
try
{
&nbs ......
libxml£¨Ò»£©
ÕªÒª
LibxmlÊÇÒ»¸öÓÐÃâ·ÑÐí¿ÉµÄÓÃÓÚ´¦ÀíXML¡¢¿ÉÒÔÇáËÉ¿çÔ ......
תÔØ×Ô£ºhttp://www.cnblogs.com/jdmei520/archive/2009/06/17/1505053.html
Webservice¼¼ÊõµÄ³öÏÖ½«¸÷ÖÖ¿ª·¢¼¼ÊõºÍÓïÑÔÍêÈ«µÄÈÚºÏÁË£¬ÏÂÃæ¾ÍÕâÖÖÈÚºÏÔÚC#ºÍdelphiÖ®¼äµÄ½»»¥×öÒ»´ÎÈ«ÃæµÄÌåÏÖ
1.ʹÓÃC#´´½¨Ò»¸öWebservice·þÎñ¡£
ʹÓÃvs2005µÄÄ£°å´´½¨C#µÄwebservice·Ç³£ÈÝÒס£ÔÎļþÈçÏÂ:
[WebService(Namespace  ......
XML ÃüÃû¿Õ¼ä¿ÉÌṩ±ÜÃâÔªËØÃüÃû³åÍ»µÄ·½·¨¡£
ÃüÃû³åÍ»
ÓÉÓÚ XML ÖеÄÔªËØÃûÊÇÔ¤¶¨ÒåµÄ£¬µ±Á½¸ö²»Í¬µÄÎĵµÊ¹ÓÃÏàͬµÄÔªËØÃûʱ£¬¾Í»á·¢ÉúÃüÃû³åÍ»¡£
Õâ¸ö XML ÎĵµÐ¯´ø×Åij¸ö±í¸ñÖеÄÐÅÏ¢£º
<table>
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</ta ......