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
相关文档:
If XML data in the table is less than 32K for each record, then you can directly unload the data as char. If XML data exceeds 32K for some records, then you have to unload the common data and the XML data separately. First, create a template for unloading XML into a PDS: TEMPLATE LOBFRV DSN 'AAA. ......
*
sql xml 入门:
--by jinjazz
--http://blog.csdn.net/jinjazz
1、xml: 能认识元素、属性和值
2、xpath: 寻址语言,类似wind ......
测试用的xml文件
<?xml version="1.0" encoding="UTF-8"?>
<schools>
<school id='111'>测试学校</school>
<school id='222'>测试学校22
<class id='2.1'>测试班级222</class>
</school>
</schools>
测试用的JavaScript代码
$().ready(function ......
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>
  ......