社区
XML/XSL
帖子详情
msxml4.dll中的那个函数可以产生跟节点,我要在程序中生成xml文件
bluecrest
2002-07-03 02:08:44
?
...全文
25
4
打赏
收藏
msxml4.dll中的那个函数可以产生跟节点,我要在程序中生成xml文件
?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
Zee
2002-07-03
打赏
举报
回复
为什么要先getdocumentElement呢?
而且pItemElement在create之后没有Append到Doc上啊。
这样试试:
m_pDoc.CreateInstance("Msxml2.DOMDocument.4.0");
// removed m_pDoc->get_documentElement(&pRoot);
pItemElement=m_pDoc->createElement("RECORD");
//Add :
m_pDoc->appendChild(pItemElement);
bsName=CString("MOBILE").AllocSysString();
varValue=_bstr_t("fdasfdasfds");
pChildElement=m_pDoc->createElement(bsName);
pChildElement->put_text(varValue);
pItemElement->appendChild(pChildElement);
bsName=CString("CONTENT").AllocSysString();
varValue=_bstr_t("fkjkfjf");
pChildElement=m_pDoc->createElement(bsName);
pChildElement->put_text(varValue);
pItemElement->appendChild(pChildElement);
m_pDoc->save(_variant_t(path));
bluecrest
2002-07-03
打赏
举报
回复
代码如下
m_pDoc.CreateInstance("Msxml2.DOMDocument.4.0");
m_pDoc->get_documentElement(&pRoot);
pItemElement=m_pDoc->createElement("RECORD");
bsName=CString("MOBILE").AllocSysString();
varValue=_bstr_t("fdasfdasfds");
pChildElement=m_pDoc->createElement(bsName);
pChildElement->put_text(varValue);
pItemElement->appendChild(pChildElement);
bsName=CString("CONTENT").AllocSysString();
varValue=_bstr_t("fkjkfjf");
pChildElement=m_pDoc->createElement(bsName);
pChildElement->put_text(varValue);
pItemElement->appendChild(pChildElement);
m_pDoc->save(_variant_t(path));
出错如下
文档缺少一个顶层元素
bluecrest
2002-07-03
打赏
举报
回复
那如何产生document呢
没有这个对象我是不能createnode的
Zee
2002-07-03
打赏
举报
回复
CreateNode即可。
根节点和子节点在创建上没有什么不同
VC 使用
msxml
6.
dll
动态链接库
中
的
函数
读写
XML文件
VC 使用
msxml
6.
dll
动态链接库
中
的
函数
读写
XML文件
MFC使用自带的
MSXML
6.
dll
解析xml(开发环境vc2010)
程序
是win32控制台
程序
//
msxml
.cpp : 定义控制台应用
程序
的入口点。 #include "stdafx.h" #include <iostream> #include <atlstr.h> #import <
MSXML
6.
dll
> using namespace
MSXML
2; ...
XML文件
解析(在Windows环境MFC
程序
中
,使用自带的
MSXML
6.
dll
解析)
XML文件
解析
在vc
中
使用组件的两种方法
假如我们想调用
msxml
4.
dll
中
提供的组件来操作
XML文件
.那么首先要调用#import "
msxml
4.
dll
", 然后你就可以使用
msxml
4.
dll
中
提供的组件了,比如说::CoInitialize(NULL);//初始化COM环境 一定要加 不要忘记!!!
MSXML
2...
msxml
2.0 3.0 4 6.0 区别
Msxml
.
dll
1.0 ..... 2.5
Msxml
2.
dll
2.6
Msxml
3.
dll
3.0
Msxml
4.
dll
4.0
Msxml
5.
dll
5.0 office 2003 -2007
Msxml
6.
dll
6.0 6.0控件太多
XML/XSL
8,906
社区成员
22,678
社区内容
发帖
与我相关
我的任务
XML/XSL
XML/XSL相关问题讨论专区
复制链接
扫一扫
分享
社区描述
XML/XSL相关问题讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章