XMLÎļþ°ó¶¨Êý¾Ý¼¯¿Ø¼þ²Ù×÷
//Êý¾Ý°ó¶¨
public void DataBind()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(@"App_data/dbGuest.xml"));
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}
//Ìí¼Ó
public void XmlDataAdd()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(@"App_data/dbGuest.xml"));
DataRow dr = ds.Tables[0].NewRow();
dr["Name"] = "spark";
dr["City"] = "tokyo";
dr["Email"] = "jis@163.com";
dr["Message"] = "thank you";
dr["STime"] = DateTime.Now.ToString();
ds.Tables[0].Rows.Add(dr);
ds.WriteXml(Server.MapPath(@"App_data/dbGuest.xml"));
}
dbGuest.xml
<?xml version="1.0" standalone="yes"?>
<dbGuest xmlns="http://tempuri.org/dbGuest.xsd">
<User>
<Name>shaoazhd</Name>
<City>beijing</City>
<Email>sss@22.net</Email>
<Message>afsa</Message>
</User>
<User>
&
Ïà¹ØÎĵµ£º
XMLÎļþ
<?xml version="1.0" encoding="utf-8"?>
.......
ÒòΪÔÒòºÜ¶à£¬ËùÒÔÕâ¸ö·½·¨²»Ò»¶¨Äܽâ¾öÎÊÌâ
XMLDocument1.LoadfromFile('test.XML');
XMLDocument1.Active:=TRUE;
XMLDocument1.Encoding:='gb2312';
memo1.Text:=XMLDocument1.XML.Text; ......
Õª×Ô--http://www.moandroid.com/?p=821
Android¶ÁдXML£¨ÖУ©——SAX
By: º£ÊÐò×Â¥ | In: Android¿ª·¢
22 ¾Å 2009
ÔÚAndroid¶ÁдXML£¨ÉÏ£©——package˵Ã÷ÖУ¬Ïêϸ½éÉÜÁËʹÓà DOM·½·¨¶ÁÈ¡XMLÎĵµ£¬ÓÉÓÚʹÓÃDOM·½·¨ÐèÒª½«Õû¸öXMLÎĵµ¼ÓÔØÄÚ´æÖУ¬¶Ôϵͳ×ÊÔ´Õ¼ÓñȽ϶࣬Õâ¶ÔÄÚ´æ±È½Ï½ôÕŵ ......
Ò»¡¢¼òµ¥½éÉÜ
using System.Xml;
//³õʼ»¯Ò»¸öxmlʵÀý
XmlDocument xml=new XmlDocument();
//µ¼ÈëÖ¸¶¨xmlÎļþ
xml.Load(path);
xml.Load(HttpContext.Current.Server.MapPath("~/file/bookstore.xml"));
//Ö¸¶¨Ò»¸ö½Úµã
XmlNode root=xml.SelectSingleNode("/root");
//»ñÈ¡½ÚµãÏÂËùÓÐÖ±½Ó×Ó½Úµã
XmlNodeList ch ......
[System.Runtime.Serialization.DataMemberAttribute()]
public Information Archive {
get {
&n ......