xmlµÄ¶ÁÈ¡ÎÊÌâ - .NET¼¼Êõ / C#
</linestops>
- <stop>
<!--Õ¾µã-->
<stops id="1">
<name>Êý×Ö</name>
<vlue>181Ò½Ôº</vlue>
</stops>
<stops id="2">
<name>?</name>
<vlue>µç×Ó¿Æ´ó,¶«½,¶«½Êг¡,¶«Õò·,·ï±±Â·¿Ú,»ð³µÕ¾,½ÌÓýѧԺ,ÂÃÓÎÅú·¢³Ç,ÄÏϪ¹«Ô°,ÄÏϪҽԺ,ʮһÖÐѧ,Î÷·ç·¿Ú,Î÷·ï·,Î÷ÃŲËÊÐ,Î÷ÃÅÊг¡,ÏóɽÇøÕþ¸®</vlue>
</stops>
<stops id="3">
<name>A</name>
<vlue>°«É½ÌÁ,°²ÐÂСÇø,°ÂÁÖÆ¥¿Ë»¨Ô°,°ÄÖÞ»¨Ô°,°ÄÖÞ¼ÙÈÕ</vlue>
</stops>
</stop>
</linestops>
ÎÒÏëÓÃÒ»¸ö¶þάÊý×éÀ´±£´æÒÔÉÏÊý¾Ý£¬µÚÒ»Áдæname,µÚ¶þÁдævlue,ÇëÎÊÒ»ÏÂÔõôʵÏÖ¡£
½¨ÒéÄãÓÃLIST£¬±È½Ï·½±ã¡£
±ÈÈ磺
List<Stop> list=new List<Stop>();
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load("XMLÎļþ·¾¶");
System.Xml.XmlNodeList nodes = doc.DocumentElement.SelectNodes("//stops");
if (nodes != null)
{
foreach(XmlNode node in nodes)
{
string name= node.ChildNodes[0].InnerText;
Ïà¹ØÎÊ´ð£º
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
˼·£ºÒªÓÃc#Éú³ÉÒ»¸ö²¥·Å»úµÄ²¥·ÅÁбíµÄxml£¬ÀýÈ磺
<daty datys='2010-04-05' datye='2010-05-01' > //ÕâÊDz¥·ÅµÄÈÕÆÚ¶Î
<time times='01:12:00' timee='02:30:00'> ......
ÎÒÓÃXmlDocumentÉú³ÉXML
XmlElement remarkNode = node.OwnerDocument.CreateElement("remark");
remark1Node.InnerXml = "";
Èç¹ûInnerXml¸³Öµ²»Îª¿Õ£¬ÔòÉú³ÉµÄ±ê¼ÇÊÇûÎÊÌâµÄ£¬±ÈÈ磺<r ......
ʹÓÃACCESS×î´óµÄÒþ»¼¾ÍÊDz»°²È«¡£½ñÌì¶ÔACCESSÊý¾Ý¿âÉèÖÃÁËÒ»¸öÃÜÂ룬±ØÐëʹÓÃÃÜÂë²ÅÄÜ´ò¿ª£¬µ«ÊÇÔÚ³ÌÐòÖÐÈ´ÎÞ·¨Á¬½ÓÊý¾Ý¿âÁË¡£´ó¼ÒÖªµÀʹÓÃÓû§ÃûºÍÃÜÂ룬ÈçºÎÁ¬½ÓACCESSÊý¾Ý¿â£¿Ã²ËÆACCESSµÄÓû§Ãû»¹²»ÖªµÀ£¿Ö»Öª ......