易截截图软件、单文件、免安装、纯绿色、仅160KB

如何在VC环境下编写程序读取XML文件

如何在VC环境下编写程序读取XML文件?清提供源代码.谢谢.
#import <msxml3.dll> named_guids  //导入动态库,装了IE5就有
using namespace MSXML2;     //引用命名空间,一般可以把命名空间理解成类和接口的集合,呵呵,对不对我也不知道了
#include <vector>
using namespace std;
struct FIELD
{
public:
 CString  name;
 CString  type;
 CString  length;
 CString  explain;
 CString  allowNull;
 CString  autoIncrease;
};
class Xml
{
public:
 Xml(void);
 ~Xml(void);
private:
 HRESULT hr;
 MSXML2::IXMLDOMDocumentPtr pDoc; //XML文档接口指针
public:
 void AddKey(CString moduleName,CString keyName, CString keyValue);
 CString ReadKeyValue(CString moduleName, CString keyName);
private:
 void NewDocument(CString moduleName, CString keyName, CString keyValue);
public:
 bool ReadTable(CTreeCtrl * tree);
 bool ReadFields(CString tableName,vector<FIELD> &fields);
 bool SaveTable(vector<FIELD> fields,CString tableName,bool bNew);
};
//-------------------------------------------------------------------------------------------------------------------------------------
上面是头文件,这是cpp文件
#include "StdAfx.h"
#include "xml.h"
Xml::Xml(void)
{
 CoInitialize(NULL);                       //初始化COM
 hr=CoCreateInstance(MSXML2::CLSID_DOMDocument,NULL,CLSCTX_ALL,MSXML2::IID_IXMLDOMDocument,(void**)&pDoc); //创建XML文档实例
}
Xml::~Xml(void)
{
 CoUninitialize();
}
void Xml::AddKey(CString moduleName,CString keyName, CString keyValue)
{
 CString selectString="AppSetting/"+moduleName;                //XML节点定位字符串,定位到节点名为


相关文档:

java 操作XML文件(片段)

//create a new Document
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document d = db.newDocument();

//add root Node
Element noteuser = d.createElement("note-users");
d.appendChil ......

C#开发XML WebService接口(SOAP)

原文链接:http://www.cnblogs.com/ding0910/archive/2007/07/12/815407.html
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using BX.Interface; ......

xml 读写

读:
//打开某文件(假设web.config在根目录中)
string filename=Server.MapPath("/") + @"WebApplication1\web.config";
XmlDocument xmldoc= new XmlDocument();
xmldoc.Load(filename);
//得到顶层节点列表
XmlNodeList topM=xmldoc.DocumentElement.ChildNodes;
foreach(XmlElement element in topM)
{
if(ele ......

spring xercesImpl xml 解析问题

问题描述:
   jboss应用服务器,使用spring 
   无法启动服务,错误日志:
[org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@155d3a3] does not
support XML Schema. Are you running on Java 1.4 or below with Apache
Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD ......

objective c xml解析

    今天在CC上看到evangel在招人,上面写了一条数据解析,我想应该就是对XML的解析吧,暂且这样理解了,呵呵。下午搜索了一点东西自己弄了一个XML然后读读看看,现在仅仅是读出了一些东西,先保存代码,待后续更新!
    这个是我创建的xml文件,用于测试用的:
<?xml version="1.0" e ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号