×Éѯһ¸öxml½Úµã²éÕÒµÄÎÊÌâ
¼ÙÉè´æÔÚÒÔÏÂxmlÎĵµ"XMLFile1.xml"
XML code:
<?xml version="1.0" encoding="utf-8" ?>
<µµ°¸>
<²¿ÃÅ Text="ÏúÊÛ²¿">
<Ô±¹¤ Text="ÕÅÈý"></Ô±¹¤>
<Ô±¹¤ Text="ÀîËÄ"></Ô±¹¤>
</²¿ÃÅ>
<²¿ÃÅ Text="²ÆÎñ²¿">
<Ô±¹¤ Text="ÍõÎå"></Ô±¹¤>
<Ô±¹¤ Text="ÕÅÈý"></Ô±¹¤>
</²¿ÃÅ>
</µµ°¸>
ÎÒÓÃÒÔÏ´úÂëÀ´ÌáÈ¡"ÏúÊÛ²¿"µÄ"ÕÅÈý"½Úµã,µ«½á¹ûÔõôΪ¿ÕÄØ?
C# code:
XmlDocument doc = new XmlDocument();
doc.Load("XMLFile1.xml");
string xpathText = "/*[@Text='ÏúÊÛ²¿']/*[@Text='ÕÅÈý']";
XmlElement elem = (XmlElement)doc.SelectSingleNode(xpathText);
{{--
Ïà¹ØÎÊ´ð£º
vbÖÐÔõôͨ¹ýxmlÀ´½âÎöÊý¾Ý¿âÖеÄ×Ö¶ÎÖµ¡£
û°ì·¨ÓÃXML½âÎöÊý¾Ý¿âµÄ×Ö¶ÎÖµ£¬³ý·ÇÊý¾Ý¿âÖб£´æµÄÊÇXML¸ñʽµÄ×Ö·û´®Îĵµ¡£
XMLÓÃÀ´Õ¹Ê¾²ã´ÎµÄÊý¾Ý¡£
Êý¾Ý¿âÒ»°ãÊǶþάÊý¾Ý¡£
Êý¾Ý¿âÖб£´æµÄÊÇXML×Ö·û´®¸ñʽ£ ......
RT
ÓÐûÓÐÔ´ÂëʵÀý£¡
лл£¡
²»ÊÇÓÐdom4jÕâÑùµÄ½âÎöxmlÎļþµÄ°üô ¸ÉÂï·ÇÒªÓÃÕýÔò£¿
Êܲ»ÁË£¡
Ã²ËÆ²»ÐаÉ
ÓУ¬ºÃ¼¸¸öÄØ£¬DOM,jdom£¬dom4j¡£¡£
¹þ¹þ£¡
ÓÉÓÚÎÒµÄxml±àÂë¸ñʽÓеãÎÊÌ⣬² ......
ÈçÌ⣬ÓÐûÓÐÕâÑùµÄphp´úÂë¡£ÎÒÏÖÔÚÏ뽫excelµÄÄÚÈݲåÈëmysqlÊý¾Ý¿â£¬Ï£Íû¿ÉÒÔ½«excelת³Éxml,È»ºó½âÎöxml²åÈëÊý¾Ý¿âÖС£Èç¹ûÓÐÕâÑùµÄ´úÂ룬ÉõÖÁÊÇÓÐÃûµÄ´úÂ룬һ¶¨Òª¸æËßÎÒ°¡¡£
ÏȶÁ excel => È»ºóÉú³É xml = ......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽÎļþ
<folder state="unchecked" label="È«²¿">
¡¡¡¡<folder state="unchecked" isBra ......