xml的简单操作
在很多情况下, 我们会用到XML,比如说配置文件等.C#提供了XML类.
这里我只是简单的写一下XML文件的生成,解析就不多说了.
第一种方法
DataBase db = DataBaseFactory.CreateDataBase(DataBaseType.MySql, strMysql);
DbCommand command = db.GetSqlStringCommand(strSql);
DataTable dt = db.ExecuteDataSet(command).Tables[0];
//string strFileName = Application.StartupPath + "\\" + "test.xml";
DirectoryInfo file = new DirectoryInfo(strPath);
if (!file.Exists)
{
file.Create();
}
string strFileName = strPath + "\\tech.xml";
XmlDocument oXmlDocument = new XmlDocument();
XmlDeclaration xde;
xde = oXmlDocument.CreateXmlDeclaration("1.0", null, null);
xde.Encoding = "gb2312";
xde.Standalone = "yes";
oXmlDocument.AppendChild(xde);
XmlElement xe = oXmlDocument.CreateElement("Root");
//XmlNode root = oX
相关文档:
//这是添加
private void button1_Click(object sender, EventArgs e)
{
string s = "Persist Security Info=False;Integrated Security=SSPI;database=IIntegration;server=(local)";
&n ......
转:http://hi.baidu.com/oneshotonekill/blog/item/be68b513f7c929d7f6039e1e.html
Whitespace is not allowed before an XML Processing Instruction (< ? ... ?>). HTMLComponent.Eclipse在编辑mxml的时候提示这样的错误。检查才发现代码中在<? ?>之前存在空格。 ......
XML 作为数据源的实例(TESTED)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" preinitialize="preInit()" fontSize="12" height="500">
<mx:Script>
  ......
XML How to Program
Beginning Xml Databases
Beginning XSLT and XPath Transforming XML Documents and Data
ASP.NET 2.0 XML
XML 手册 4th Edition
XML Schema Complete Reference
......
Introduction to XML and XML With Java
If you are looking for sample programs to parse a XML file using DOM/SAX parser or looking for a program to generate a XML file please proceed directly to programs.
This small tutorial introduces you to the basic concepts of XML and using Xer ......