¶ÁÈ¡xmlʱ EntityName ʱ³ö´í
public static Hashtable xml_unserialize(string strXml)
{
//¼ÓÉÏÏÂÃæÕâ¾ä¾ÍºÃÁË
strXml = strXml.Replace("&", "&");
Hashtable ht = new Hashtable();
XmlDocument XMLDom = new XmlDocument();
XMLDom.LoadXml(strXml);
XmlNode newXMLNode = XMLDom.SelectSingleNode("root");
int i = 0;
foreach (XmlNode xn in newXMLNode.ChildNodes)
{
ht.Add(i++, xn.InnerText);
}
return ht;
}
> ºÍ < ÕâÀà×Ö·ûÊÇXML ±ê¼Ç×Ö·û£¬ÔÚ XML ÖÐÓÐÌØÊâµÄº¬Òå¡£µ±ÔÚ SQL ²éѯ£¨»ò XPath ²éѯ£©ÖÐÖ¸¶¨ÕâЩ×Ö·ûʱ£¬±ØÐë¶ÔËüÃǽøÐÐÊʵ±µÄ±àÂ루Ҳ³ÆΪʵÌå±àÂ룩¡£Ï±íÁгöÁËÕâЩÌØÊâ×Ö·û²¢ÃèÊöÁËËüÃǵĺ¬Òå¡£Óйظü¶àÐÅÏ¢£¬Çë²Î¼û XML 1.0 ¹æ·¶ ÖÐµÄ XML 1.0 ¹æ·¶¡£
ÌØÊâ×Ö·û ÌØÊ⺬Òå ʵÌå±àÂë
> ¿ªÊ¼±ê¼Ç >
< ½áÊø±ê¼Ç <
" ÒýºÅ "
' ƲºÅ '
& "&"·û &
XML ½ÚµãÖв»ÄÜ°üº¬ÕâЩÌØÊâ×Ö·û£¬“&”£¬“<”£¬“>”£¬²»È»½âÎöʱ´ËXML»á±¨´í£¬Ê¹ÓÃʱÐèÒª¶ÔËüת»»ÏÂwww.kobsky.cn СÑÛÊÀ½çãÚ$¡qyßTL
Ïà¹ØÎĵµ£º
C#ÐòÁл¯xml
¹Ø¼ü²½Ö裺
XmlSerializer xSerializer = new XmlSerializer(typeof(MyObj));
StringWriter sWriter = new StringWriter(CultureInfo.InvariantCulture);
XmlTextWriter xTextWriter = new XmlTextWriter(sWriter);
......
×Ô¼º×öÏîÄ¿ÐèÒªÓÃÖÇÄÜ¿Í»§¶Ë·¢²¼£¬ÎÒÓöµ½Á˸öÎÊÌâ¾ÍÊdzÌÐòÖеÄxmlÎļþÔÚ·¢²¼ºóÕÒ²»µ½ÁË¡£¾¹ýÔÚÍøÉϲéѯºÍ×Ô¼ºµÄÊÔÑé·¢ÏÖÕâÁ½¸ö·½·¨¶¼¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£
·½·¨1
ÓÒ¼üwinUIÏîÄ¿£¬·¢²¼-¡µÓ¦ÓóÌÐòÎļþ....->Ñ¡ÔñxmlÎļþ-¡µ·¢²¼×´Ì¬¸ÄΪ“Êý¾ÝÎļþ(×Ô¶¯)”
&nb ......
<!-- xml ¸ñʽ
<books>
<book id='1001'>
<author>andylin</author>
<title>c language</title>
<publisher id="aaa">O'Reilly</publisher>
</book>
<book id='1002'>
<author>congfeng</author>
<t ......
ºÎνLINQ? LINQ¼´.NET ÓïÑÔ¼¯³É²éѯ(.NET Language-Integrated Query (LINQ) Framework),Ϊ.NET¼Ü¹¹ÖеÄÖØÒª×é³É²¿·Ö¡£LINQϵÁм¼ÊõÌṩÁËÕë¶Ô¶ÔÏó(LINQ)¡¢¹ØϵÊý¾Ý¿â(LINQ to SQL)ºÍXML(LINQ to XML)µÄÒ»ÖÂÐÔ²éѯÌåÑé¡£ ʲôÊÇLINQ to XML? LINQ to XML ʹÓÃ×îеÄ.NET FrameworkÓïÑÔ¹¦ÄÜ£¬Ï൱ÓÚ¸üкÍÖØÐÂÉè¼ÆµÄÎĵµ¶ ......