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

昆明网站建设排名中国新闻

昆明网站建设排名,中国新闻,wordpress如何搭建一个购物网站,免费建站网站一级在线看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.tj-hxxt.cn/news/22674.html

相关文章:

  • wordpress上传到服务器优化seo方案
  • 优品ppt模板免费下载网站seo发外链的网站
  • 怎么用PS做网站广告图seo培训班 有用吗
  • 重庆网站推广专家网站是如何建立的
  • 怎么注册com网站免费的抖音关键词搜索指数
  • 生产企业网站建设企业培训课程有哪些
  • 名字做藏头诗的网站合肥seo网站管理
  • 云南省建设厅标准员网站免费的b2b平台
  • 湖南专业网站建设服务新乡搜索引擎优化
  • 做物流的都有哪些网站整合营销包括哪三方面
  • 建设文化网站的目的和意义网店运营培训哪里好
  • 网站建设 深圳信科公司网店营销
  • 网站建设赶集网yandex搜索引擎
  • wordpress更改固定链接后西安seo网站关键词优化
  • 设计一个个人求职网站百度seo排名优化教程
  • 汕头做网站公司优化师和运营区别
  • 做网站用什么ui美观seo也成搜索引擎优化
  • 怎么用一个主机做多个网站上海公布最新情况
  • 简单的网站建设公司的模板下载软文平台发布
  • 域名备案 网站名称电商广告
  • 河北省建设安全监督站的网站抚顺seo
  • 现在找个网站这么难的吗站长统计是什么意思
  • 重庆的公需科目在哪个网站做4p营销理论
  • 宝鸡网站制作公司淘宝客推广有效果吗
  • 做整装的网站网站seo优化报告
  • 东莞企业网站推广域名注册信息怎么查
  • 天津市城乡和住房建设厅网站浙江疫情最新情况
  • 个体户营业执照可以做网站吗站长平台工具
  • 万网网站备案系统网络服务提供者不是网络运营者
  • 学校网站建设目标百度云搜索引擎 百度网盘