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

LINQ to XML ѧϰ±Ê¼Ç

LINQ to XML ¿ÉÒÔ¿´×÷ÊÇÒ»¸ö “better DOM” ±à³ÌÄ£ÐÍ£¬¿ÉÒÔºÍ System.Xml.dll ³ÌÐò¼¯Öеĺܶà³ÉÔ±½»»¥¡£
Ò»¡¢ÃüÃû¿Õ¼ä
System.Xml.Linq.dll ³ÌÐò¼¯¶¨ÒåÁËÈý¸öÃüÃû¿Õ¼ä£ºSystem.Xml.Linq, System.Xml.Schema  ºÍ System.Xml.XPath
×îºËÐĵÄÊÇ System.Xml.Linq£¬ ¶¨ÒåÁ˶ÔÓ¦ XML Îĵµ¸ö·½ÃæµÄºÜ¶àÀàÐÍ
Member of System.Xml.Linq
Meaning in Life
XAttribute
Represents an XML attribute on a given XML element
XComment
Represents an XML comment
XDeclaration
Represents the opening declaration of an XML document
XDocument
Represents the entirety of an XML document
XElement
Represents a given element within an XML document
XName/XNamespace
Provide a very simple manner to define and reference XML namespaces
¶þ¡¢±à³Ì·½Ê½´´½¨XMLÎĵµ
ÒÔǰµÄ .NET XML±à³ÌÄ£ÐÍÐèҪʹÓúܶàÈß³¤µÄ DOM API£¬¶ø LINQ to XML ÔòÍêÈ«¿ÉÒÔÓÃÓë DOM Î޹صķ½Ê½Óë XML Îĵµ½»»¥¡£ÕâÑù²»µ«´ó´ó¼õÉÙÁË´úÂëÐУ¬¶øÇÒÕâÖÖ±à³ÌÄ£ÐÍ¿ÉÒÔÖ±½ÓÓ³Éäµ½¸ñʽÁ¼ºÃµÄXMLÎĵµ½á¹¹¡£
static void CreateFunctionalXmlElement()
{
// A "functional" approach to build an
// XML element in memory.
XElement inventory =
new XElement("Inventory",
new XElement("Car", new XAttribute("ID", "1"),
new XElement("Color", "Green"),
new XElement("Make", "BMW"),
new XElement("PetName", "Stan")
)
);
// Call ToString() on our XElement.
Console.WriteLine(inventory);
}
ÔÚÄÚ´æÖд´½¨XMLÎĵµ
        static void CreateFunctionalXmlDoc()
        {
            XDocument inventoryDoc =
            new XDocument(
            new XDeclaration("1.0", "utf-8", "yes"),
    &n


Ïà¹ØÎĵµ£º

XML ÑéÖ¤

ת×Ô£ºhttp://www.w3school.com.cn/xml/xml_dtd.asp
ÓµÓÐÕýÈ·Óï·¨µÄ XML ±»³ÆÎª“ÐÎʽÁ¼ºÃ”µÄ XML¡£
ͨ¹ýij¸ö DTD ½øÐÐÁËÑéÖ¤µÄ XML ÊÇ“ºÏ·¨”µÄ XML¡£
ÐÎʽÁ¼ºÃµÄ XML Îĵµ
Ò»¸ö"ÐÎʽÁ¼ºÃ"µÄ XML ÎĵµÓµÓÐÕýÈ·µÄÓï·¨¡£
Ò»¸ö"ÐÎʽÁ¼ºÃ"µÄ XML Îĵµ»á×ñÊØÇ°¼¸Õ½éÉܹýµÄ XML Óï·¨¹æÔò£º
XML 뀵 ......

GridView ²Ù×÷XMLÎļþ

<?xml version="1.0" standalone="yes"?>
<imgs>
<pic name="/adv_pic/1.jpg" url="http://www.baidu.com/" title="test" />
<pic name="/adv_pic/2.jpg" url="http://www.baidu.com/" title="test" />
......

FusionCharts µÄXML±êÇ©ÊôÐÔ

FusionCharts µÄ XML±êÇ©ÊôÐÔÓÐÒ»ÏÂËÄÖÖÊý¾ÝÀàÐÍ
* Boolean - ²¼¶ûÀàÐÍ£¬Ö»ÄÜΪ1»òÕß0¡£ÀýÈ磺<graph showNames=’1′ >
* Number - Êý×ÖÀàÐÍ£¬Ö»ÄÜΪÊý×Ö¡£ÀýÈ磺<graph yAxisMaxValue=’200′ >
* String - ×Ö·û´®ÀàÐÍ£¬Ö»ÄÜΪ×Ö·û´®¡£ÀýÈ磺 <graph caption=’My Chart&rsqu ......

°ÑXMLDocumentת»»³Éxml×Ö·û´®

XMLDocumentÀàÌṩÁ˷ḻµÄÊôÐԺͷ½·¨£¬¿ÉÒÔ°ïÖúÎÒÃÇÇáËÉÍê³ÉxmlµÄ±à¼­¡£µ«ÊÇ£¬Íê³ÉºóµÄxmlºÜ¶àÇé¿öÏ¿ÉÄÜ»¹ÊÇÐèÒªÒÔ×Ö·û´®ÐÎʽ´«µÝ¡£XMLDocumentÓиöSave·½·¨£¬²»½ö¿ÉÒÔ±£´æXMLÎļþÖÁ´ÅÅÌ£¬»¹Äܽ«Æä±£´æÖÁÖ¸¶¨µÄÁ÷£¬È»ºó£¬¾ÍÄÜ´ÓÕâ¸öÁ÷£¨stream£©¶ÁÈ¡ËùÐèÒªµÄ×Ö·û´®ÁË¡£
XmlDocument doc = new XmlDocument();
...
.../ ......

D Busѧϰ£¨°Ë£©£ºÀûÓÃXML¶¨ÒåD BusÖ®ServerµÄÀý×Ó


¡¡¡¡ÔÚ´ËÏȸÐлhttp://blog.chinaunix.net/u3/111961/showart_2187819.html
¡£ÕâÊÇÆª¼«ºÃµÄÎÄÕ¡£
¡¡¡¡ÔÚÉÏ´ÎѧϰÖУ¬ÎÒÃÇдÁËclientСÀý×Ó£¬·Ç³£¼òµ¥£¬¶øÇÒͨ¹ýdbus-binding-toolÉú³ÉµÄÍ·Îļþ£¬·Ç³£¹æ·¶¡£Ïà±ÈÖ´ÐУ¬serverÉÔ΢¸´ÔÓЩ£¬ÈÔȻʹÓÃÉϴεÄxmlÎļþ£¬µ«ÊÇÈ¥µôannotation£¬¸üΪ±¾Ô­Ò»Ð©¡£Îļþwei.xmlÈçÏ£º
& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ