XML 增、删、改、求平均数
string file = "c:\\work.xml";
private void btnCearte_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
XmlDeclaration dl = doc.CreateXmlDeclaration("1.0", "Unicode", null);
doc.AppendChild(dl);
XmlElement @class = doc.CreateElement("class");
doc.AppendChild(@class);
doc.Save(file);
}
private void btnInsert_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load(file);
XmlElement student = doc.CreateElement("student");
student.SetAttribute("age", "20");
XmlElement name = doc.CreateElement("name");
name.InnerText = "童小霞";
XmlElement sex = doc.CreateElement("sex");
sex.InnerText = "famale";
student.AppendChild(name);
student.AppendChil
相关文档:
http://stackoverflow.com/questions/1112828/cannot-decode-string-with-wide-characters-appears-on-a-weird-place
http://man.ddvip.com/web/xmlzhzn/xml_cn/xml_encoding.asp.htm
http://bbs.xml.org.cn/dispbbs.asp?boardID=8&ID=7226
http://topic.csdn.net/t/20030909/13/2240153.html
#
http://www.ezloo. ......
get
jsp url ${param.serialID}
action jsp String commentId = ServletActionContext.getRequest().getParameter("commentId");
-- ......
已知有一个XML文件(bookstore.xml)如下:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
<price>5.95</price> ......
//数据绑定
public void DataBind()
{
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(@"App_data/dbGuest.xml"));
&nbs ......