使用XmlDocument类完成对XML的查、删、添、改
使用XmlDocument类完成对XML的查、删、添、改
http://www.aspdiy.net/article/53.htm
后台C#代码
1using System;
2using System.Collections;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Web;
7using System.Web.SessionState;
8using System.Web.UI;
9using System.Web.UI.WebControls;
10using System.Web.UI.HtmlControls;
11//新引入两个命名空间
12using System.Xml;
13using System.Xml.XPath;
14
15namespace XML
16{
17 /**//// <summary>
18 /// xdoc 的摘要说明。
19 /// </summary>
20 public class xdoc : System.Web.UI.Page
21 {
22 protected System.Web.UI.WebControls.Label Label1;
23 protected System.Web.UI.WebControls.Label Label2;
24 protected System.Web.UI.WebControls.Button Button1;
25 protected System.Web.UI.WebControls.Label Label3;
26 protected System.Web.UI.WebControls.Button Button2;
27 protected System.Web.UI.WebControls.Button Button3;
28 protected System.Web.UI.WebControls.DataGrid dg;
29 protected System.Web.UI.WebControls.DropDownList ddl;
30 protected System.Web.UI.WebControls.TextBox tbn;
31 protected System.Web.UI.WebControls.Label Label4;
32 protected System.Web.UI.WebControls.Label Label5;
33 protected System.Web
相关文档:
<Records>
<Record>
<id>1 </id>
<name>李四 </name>
</Record>
<Record>
<id>2 </id>
<name>张三 </name>
</Record>
<Record>
<id>3 </id>
<name>王五 </name>
</Record& ......
Product.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="product.css" ?>
<productata>
<product prodid="p001" category="toy">
<productname>Mini Bus</productname>
<description>This is a toy for childern aged 4 and above&l ......
最近项目中要用到一些web xml数据的访问分析,采用msxml
1.msxml是微软提供的,在非开发环境中,需要注册
2.xml文件,一般在第一句有编码方式,一般默认是utf-8,属于一种unicode
3.从网络采集的xml数据,需要使用winnet函数库
4.winnet采集自网络的数据,默认的都是CP_ACP格式的,简单说就是ANSI或UNICODE,UTF8的编码 ......
读XML文件
DataSet books = new DataSet();
books.ReadXml(MapPath("booklist.xml"));
booklist.DataSource = books;
booklist.DataBind(); ......
XML文件由于其扩展性与兼容性的优点,被广泛用作软件和系统的配置文件。这里简要介绍一下QT下如何来解析XML文件。
源代码:
xml_reader.h
#ifndef XML_READER_H
#define XML_READER_H
#include <QtCore>
//#include <QtGui>
class xml_reader : public QXmlStreamReader
{
//Q_OBJECT
public:
......