EasyXML使用指南文档信息项目名称EasyXML-通用XML解析器需求编号文档编号作者曾臻创建日期2006-3-++开发的XML解析器,它利用了C++的函数重载、函数对象等语言特性方便了程序员对XML解析代码的编写。本库不依赖于其它的XML解析器(如XML4C),实现上完全基于STL。:#include""#include<string>#include<iostream>#include<fstream>voidmain(){//createrootelementElementinfo("info",Element::ROOT|Element::COMPLEX);//createandassemblepetelementsElementpet("pet");("species","mouse")("sex","female")("age","1")("name","Jerry")("weight","200g");(pet);pet("species")="cat";pet("sex")="male";pet("age")="2";pet("name")="Tom";pet("weight")="2kg";(pet);//createandassemblebandelementsElementband("band");("name","BEYOND")("style","ArtRock")("members","5")("birthday","1983");Elementmember("member");("name","HuangJiaJu")("position","Voice,LeadGuitar");(member);member["name"]="HuangJiaQiang";member["position"]="Bass";(member);(band);//generatexmlstringstringoutXml;Parserparser;parser<<info>>outXml;//outputtoxmlfileofstreamof("");of<<outXml;();}::#include""#include<string>#include<iostream>#include<fstream>voidmain(){//inputfromxmlfileifstreamfile("");stringinXml;while(!())inXml+=();();//parse
Easy XML使用指南 来自淘豆网m.daumloan.com转载请标明出处.