当前位置: 首页 > news >正文

大城b2c网站建设报价企业课程培训

大城b2c网站建设报价,企业课程培训,如何发布网站到域名,php面向对象网站开发rapidxml是一个快速的xml库,由C模板实现的高效率xml解析库,同时也是boost库的property_tree的内置解析库。 当时rapidxml时,只需要把rapidxml.hpp 、 rapidxml_print.hpp 和 rapidxml_utils.hpp 三个文件拷贝到你的工程目录下,就可…

      rapidxml是一个快速的xml库,由C++模板实现的高效率xml解析库,同时也是boost库的property_tree的内置解析库。

     当时rapidxml时,只需要把rapidxml.hpp 、 rapidxml_print.hpp 和 rapidxml_utils.hpp 三个文件拷贝到你的工程目录下,就可以了。


下面的是测试代码 main.cpp

#include <iostream>
#include <string>
#include <vector>
#include "rapidxml/rapidxml.hpp"
#include "rapidxml/rapidxml_print.hpp"
#include "rapidxml/rapidxml_utils.hpp"using namespace std;int main(int argc, char** argv) {vector<string>  v_str ;vector<string>::iterator it ;v_str.push_back("111111");v_str.push_back("222222");v_str.push_back("333333");v_str.push_back("444444");using namespace rapidxml;xml_document<> doc;  //构造一个空的xml文档xml_node<>* rot = doc.allocate_node(rapidxml::node_pi, doc.allocate_string("setting.xml version='1.0' encoding='utf-8'"));//allocate_node分配一个节点,该节点类型为node_pi,对XML文件进行描,描述内容在allocate_string中doc.append_node(rot); //把该节点添加到doc中xml_node<>* node = doc.allocate_node(node_element, "root", NULL);xml_node<>* analysis = doc.allocate_node(node_element, "Analysis", NULL);node->append_node(analysis);for (it = v_str.begin(); it != v_str.end(); it++) {xml_node<>* soinfo = doc.allocate_node(node_element, "soinfo", NULL);soinfo->append_attribute(doc.allocate_attribute("key", it->c_str()));analysis->append_node(soinfo);}xml_node<>* Output = doc.allocate_node(node_element, "Output", NULL);node->append_node(Output);xml_node<>* outinfo = doc.allocate_node(node_element, "outinfo", NULL);Output->append_node(outinfo);for (int j =0;j < 2; j++) {xml_node<>* type = doc.allocate_node(node_element, "desc", NULL); //分配一个type节点,type->append_attribute(doc.allocate_attribute("path", "123"));type->append_attribute(doc.allocate_attribute("relation", "345"));type->append_attribute(doc.allocate_attribute("priority", "567"));outinfo->append_node(type); //把type节点添加到节点outinfo中}for (it = v_str.begin(); it != v_str.end(); it++) {xml_node<>* rule = doc.allocate_node(node_element, "rule", NULL);Output->append_node(rule);for (int i = 0; i < 2 ; i++) {xml_node<>* cond = doc.allocate_node(node_element, "cond", NULL);cond->append_attribute(doc.allocate_attribute("key", "123"));cond->append_attribute(doc.allocate_attribute("value", "345"));cond->append_attribute(doc.allocate_attribute("relation","567"));rule->append_node(cond);}xml_node<>* out = doc.allocate_node(node_element, "out", NULL);out->append_attribute(doc.allocate_attribute("where", it->c_str()));rule->append_node(out);}doc.append_node(node);std::ofstream pout("config.xml");pout << doc;return 0;
}

下面是生成的xml文件 config.xml

<?setting.xml version='1.0' encoding='utf-8' ?>
<root><Analysis><soinfo key="111111"/><soinfo key="222222"/><soinfo key="333333"/><soinfo key="444444"/></Analysis><Output><outinfo><desc path="123" relation="345" priority="567"/><desc path="123" relation="345" priority="567"/></outinfo><rule><cond key="123" value="345" relation="567"/><cond key="123" value="345" relation="567"/><out where="111111"/></rule><rule><cond key="123" value="345" relation="567"/><cond key="123" value="345" relation="567"/><out where="222222"/></rule><rule><cond key="123" value="345" relation="567"/><cond key="123" value="345" relation="567"/><out where="333333"/></rule><rule><cond key="123" value="345" relation="567"/><cond key="123" value="345" relation="567"/><out where="444444"/></rule></Output>
</root>




http://www.hkea.cn/news/148811/

相关文章:

  • js怎么做网站跨境电商网站
  • 台州外贸网站建设百度推广费用多少
  • 虚拟机怎么做网站空间培训班管理系统 免费
  • wordpress离线文章发布郑州seo关键词排名优化
  • 龙岗区网站建设中国职业培训在线
  • 南山网站建设外包优化网站
  • 个人怎么做网站推广神起网络游戏推广平台
  • 做网站的关键技术运营推广的方式和渠道有哪些
  • jsp做就业网站网推项目
  • 网站开发的目的和意义重庆seo排名电话
  • 顺义专业建站公司最有效的线上推广方式
  • 大连网站网站搭建制作百度识图 上传图片
  • 给人做网站多少钱黑科技引流推广神器怎么下载
  • 沈阳做网站最好的公司百度快照怎么删除
  • 设置本机外网ip做网站网站免费制作平台
  • 有什么推荐做简历的网站2024的新闻有哪些
  • 申请做网站 论坛版主惠州seo外包服务
  • 网站照片上传不了域名解析ip
  • 胖小七网站建设2022最新国际新闻10条简短
  • wordpress 网站备份厦门seo外包服务
  • 网站建设及推广培训杭州百度快照优化排名
  • 简单手机网站开发软件关键词排名代发
  • visio画网站开发类图注册域名后怎么建网站
  • 道里网站运营培训北京网络营销咨询公司
  • 目前做网站流行的语言seo关键词排名优化哪家好
  • 长沙营销型网站制作费用seo图片优化
  • 学生诚信档案建设网站seo数据分析
  • 北京住房城乡建设厅网站首页1688官网入口
  • 网站建设需要懂什么软件徐州百度seo排名优化
  • wordpress网站样式网站排名查询