XMLÎļþ²Ù×÷
XmlDocument doc = new XmlDocument();
string strtxt = "";
doc.Load(Server.MapPath("XMLFile1.xml"));
XmlNode root = doc.DocumentElement;
foreach (XmlNode personElement in root.ChildNodes)
{
strtxt += "ID=" + personElement.Attributes["id"].Value + "value=" + personElement.Attributes["value"].Value + "</br>";
foreach (XmlNode xmlchild in personElement.ChildNodes)
{
strtxt += " ¶þ¼¶£ºID=" + xmlchild.Attributes["id"].Value + "value=" + xmlchild.Attributes["value"].Value + "</br>";
foreach (XmlNode xmlchild2 in xmlchild.ChildNodes)
{
strtxt += " Èý¼¶£ºID=" + xmlchild2.Attributes["id"].Value + "value=" + xmlchild2.Attributes["value"].Value + "</br>";
}
&n
Ïà¹ØÎĵµ£º
1. login_window.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bg_logo"
>
......
XML ÔªËØ
ÔªËØÃüÃû
XMLÔªËرØÐë×ñÊØÒÔϵÄÃüÃû¹æÔò£º
Ãû×Ö¿É°üº¬×Öĸ¡¢Êý×ÖÒÔ¼°ÆäËûµÄ×Ö·û
Ãû×Ö²»ÄÜÒÔÊý×Ö»òÕß±êµã·ûºÅ¿ªÊ¼
Ãû×Ö²»ÄÜÒÔ×Ö·û“xml”£¨»òÕßXML¡¢Xml£©¿ªÊ¼
Ãû×Ö²»ÄÜ°üº¬¿Õ¸ñ
µ±Äú“·¢Ã÷´´Ôì”ÔªËØÃû³Æʱ£¬ÇëÁôÒâ²¢×ñÑÏÂÃæµÄ¼òµ¥µÄ¹æÔò£º
Äú¿ÉÒÔʹÓóý±£Áô×ÖÍâµÄÈκÎÃû³Æ£ ......
¸ÃʵÀýÊ×ÏÈÐèÒª´´½¨Êý¾Ý¿â£¬Êý¾Ý¿âTestΨһ±ítest,¸Ã±í¾ßÓÐÈý¸öÁзֱðΪc1,c2,c3, intÐÍ£¬Çë×ÔÐн¨Á¢Êý¾Ý¿â²¢²åÈ뼸ÐвâÊÔÊý¾Ý¡£
È»ºóÎÒÃÇÏ£ÍûÄܽ«Êý¾Ý¿âÖеÄÊý¾Ý¶ÁÈ¡³öÀ´£¬ÎÒÔÚ´Ë´¦Ö»Êǽ«Êý¾Ý¿âÊý¾ÝÒÔÊý¾Ý¼¯µÄ·½Ê½´æ·ÅÔÚ±¾µØÖУ¬ ......
(Ò») ÏȽ²Ò»ÏÂXMLÖеÄÎïÊâ×Ö·û£¬ÊÖ¶¯ÌîдʱעÒâһϡ£
×Ö·û ×Ö·ûʵÌå
& &n ......