首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

XML字符串的读写操作函数及示例程序

整理日期:2008年03月15日 【字体:

以下为引用的内容:

// OpXML.cpp : Defines the entry point for the console application.

#include "stdafx.h"
#include <stdio.h>

//---You must Setup the MSXML4.0 before using
#import <msxml4.dll>
using namespace MSXML2;

void xmlread(char *ch1,char *ch2,char *ch3);//Read the xmlstr and Get the Text of the Element

void xmlupdate(char *ch1,char *ch2,char *ch3);//Read the xmlstr and Update the Text of the Element

int main(int argc, char* argv[])
{
 char xmlstr[1024]="<inesmsg><msghead><version>LZD</version><root>ioio</root></msghead></inesmsg>";
 char strele[1024]="//version//";
 char textstr[1024]="NNYX";
 char value[1024];

 printf("The xmlstr is :\n%s\n\n",xmlstr);

 xmlread(xmlstr,strele,value); //befor Update
 printf("The Text of Element befor Update is: \n%s\n\n",value);

 xmlupdate(xmlstr,strele,textstr);//Change the Text of "<version>" with "NNYX"
 printf("The Updated xmlstr is :\n%s\n\n",xmlstr);

 xmlread(xmlstr,strele,value);//after Update
 printf("The Text of Element after Update is :\n%s\n\n",value);

 return 0;

伊图教程网[www.etoow.com]
http://www.etoow.com/html/2008-03/1205582502.html
}
Tags:
XML字符串的读写操作函数及示例程序
'http://www.etoow.com/html/2008-03/1205582502.html
1
 
2
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved