testxml.cpp

来自「xml文件解析器 解析所有的xml文件 支持unicode」· C++ 代码 · 共 46 行

CPP
46
字号
#ifdef WIN32#define _CRT_SECURE_NO_DEPRECATE#endif#include <stdio.h>#include <string>#include "atlstr.h"#include "xmlParser.h"ToXMLStringTool testtool;using namespace std;int main(int argc, char **argv){	XMLNode xMainNode=XMLNode::parseFile(L"oldgui.xul");	//XMLNode xNode = xMainNode.getChildNode(L"window");	//CString strname = xNode.getName();	//int i = 0;	//XMLNode xNode1 = xMainNode.getChildNode(L"window",1);	//CString strname1 = xNode1.getName();	//CString strPro = xNode1.getAttribute(L"id");	//int ncount = xMainNode.nChildNode(L"window");	if(xMainNode.isDeclaration())	{		CString strtestname = xMainNode.getName();		CString strPropo = xMainNode.getAttribute(L"version");	}	int nCount = xMainNode.nChildNode();	for (int i = 0;i< nCount ;i++)	{		        XMLNode xChildNode = xMainNode.getChildNode(i);				if(!xChildNode.isEmpty())				{					CString tag = xChildNode.getName();					CString strPar = xChildNode.getAttribute(L"href");				}				
				CString pText= xMainNode.getChildNode(i).createXMLString();
					 



	}		return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?