Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

LINQ to XMLº¯Êý¹¹Ôì·½·¨

±êÇ©£ºÊý¾Ý·ÃÎÊ    LINQ to XML
    LINQ to XML²¢²»´òËãÌæ´ú±ê×¼µÄXML API£¬Ö»ÊDz¹³äÁËÕâЩ±ê×¼XMLÀà         LINQ to XMLº¯Êý¹¹Ôì·½·¨     º¯Êý¹¹½¨·½Ê½(functional construction):
    ÔÚÕâÖÖ·½Ê½ÖУ¬¹¹Ô캯ÊýµÄµ÷ÓÿÉÒÔÓ÷´Ó³XMLÎĵµ½á¹¹µÄ·½Ê½Ç¶Ìס£
    Àý£º
        .....
        XDocument xdoc = new XDocument(    //XCocument ±íʾÍêÕûµÄXMLÎĵµ                 new XELement("customers",                         new XElement("customer",                                  new XAtrribute("ID","A"),                                     new XAtrribute("City","New York"),                                  new XAtrribute("Region","North


Ïà¹ØÎĵµ£º

Linq to XML customize distinct function

Definition comparer class,
class ItemComparer : IEqualityComparer<XElement>
{
public bool Equals(XElement x, XElement y)
{
return x.Attribute("Name").Value == x.Attribute("Name").Value;
}
public int GetHashCode(XElement obj)
......

DataSet XMl DateTable »¥×ª

/// <summary>
/// DataTable-------------------->XML --String
/// </summary>
public static String ToXmlString(DataTable dt)
{
StringWriter tr = new StringWriter();
try
{
dt.WriteXml(tr); ......

ÔõôÑùÔÚÍøÒ³É϶ÁȡԶ³ÌxmlµÄÊý¾Ý

 ±¾ÎÄת×Ô£ºhttp://www.10086web.com/html/wangluobiancheng/Xmlbiancheng/2009/0612/90.html
Ò»¸ö¿Í»§Ìṩһ¸ö¹É¼ÛµÄÐÅÏ¢£¬ÒªÇó·ÅÔÚÒ³ÃæÉÏ£¬ÏÔʾһЩÊý¾Ý£¬ÐèÒª´ÓÔ¶³Ì»ñÈ¡xml£¬È»ºó½âÎöдÔÚÍøÒ³ÉÏ£¬¿ªÊ¼²»»á¾õµÃºÜÄÑ£¬ÆäʵÂù¼òµ¥µÄ£¬ÏÈÓÃjavascriptдÁËÒ»¸ö£º
<mce:script language=javascript><!--

......

XmlÖÐSelectSingleNode·½·¨ÖеÄxpathÓ÷¨

×î³£¼ûµÄXMLÊý¾ÝÀàÐÍÓУºElement, Attribute£¬Comment, Text.  
 
   Element, Ö¸ÐÎÈç<Name>Tom<Name>µÄ½Úµã¡£Ëü¿ÉÒÔ°üÀ¨£ºElement, Text, Comment, ProcessingInstruction, CDATA, and EntityReference.  
 
   Attribute, Ö¸ÔÚ<Employee >ÖеĴ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ