pugixml [![Actions Status](https://github.com/zeux/pugixml/workflows/build/badge.svg)](https://github.com/zeux/pugixml/actions) [![Build status](https://ci.appveyor.com/api/projects/status/9hdks1doqvq8pwe7/branch/master?svg=true)](https://ci.appveyor.com/project/zeux/pugixml) [![codecov.io](https://codecov.io/github/zeux/pugixml/coverage.svg?branch=master)](https://codecov.io/github/zeux/pugixml?branch=master) ![MIT](https://img.shields.io/badge/license-MIT-blue.svg)
=======
pugixml is a C++ XML processing library, which consists of a DOM-like interface with rich traversal/modification
capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer, and an XPath 1.0
implementation for complex data-driven tree queries. Full Unicode support is also available, with Unicode interface
variants and conversions between different Unicode encodings (which happen automatically during parsing/saving).
pugixml is used by a lot of projects, both open-source and proprietary, for performance and easy-to-use interface.
## Documentation
Documentation for the current release of pugixml is available on-line as two separate documents:
* [Quick-start guide](https://pugixml.org/docs/quickstart.html), that aims to provide enough information to start using the library;
* [Complete reference manual](https://pugixml.org/docs/manual.html), that describes all features of the library in detail.
You’re advised to start with the quick-start guide; however, many important library features are either not described in it at all or only mentioned briefly; if you require more information you should read the complete manual.
## Example
Here's an example of how code using pugixml looks; it opens an XML file, goes over all Tool nodes and prints tools that have a Timeout attribute greater than 0:
```c++
#include "pugixml.hpp"
#include <iostream>
int main()
{
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file("xgconsole.xml");
if (!result)
return -1;
for (pugi::xml_node tool: doc.child("Profile").child("Tools").children("Tool"))
{
int timeout = tool.attribute("Timeout").as_int();
if (timeout > 0)
std::cout << "Tool " << tool.attribute("Filename").value() << " has timeout " << timeout << "\n";
}
}
```
And the same example using XPath:
```c++
#include "pugixml.hpp"
#include <iostream>
int main()
{
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file("xgconsole.xml");
if (!result)
return -1;
pugi::xpath_node_set tools_with_timeout = doc.select_nodes("/Profile/Tools/Tool[@Timeout > 0]");
for (pugi::xpath_node node: tools_with_timeout)
{
pugi::xml_node tool = node.node();
std::cout << "Tool " << tool.attribute("Filename").value() <<
" has timeout " << tool.attribute("Timeout").as_int() << "\n";
}
}
```
## License
This library is available to anybody free of charge, under the terms of MIT License (see LICENSE.md).
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
pugixml-master.zip (187个子文件)
manual.adoc 225KB
quickstart.adoc 24KB
config.adoc 185B
pugixml_codeblocks.cbp 1KB
pugixml.cpp 336KB
test_dom_modify.cpp 62KB
test_parse.cpp 48KB
test_document.cpp 47KB
test_dom_traverse.cpp 43KB
test_xpath_paths.cpp 34KB
test_xpath.cpp 32KB
test_xpath_functions.cpp 31KB
test_parse_doctype.cpp 27KB
test_xpath_xalan_2.cpp 26KB
test_xpath_xalan_3.cpp 23KB
test_write.cpp 22KB
test_xpath_parse.cpp 22KB
test_xpath_operators.cpp 21KB
test_xpath_xalan_4.cpp 20KB
test_dom_text.cpp 18KB
test_xpath_variables.cpp 18KB
test_xpath_xalan_1.cpp 17KB
test_xpath_api.cpp 15KB
test_xpath_xalan_5.cpp 14KB
test_xpath_paths_w3c.cpp 11KB
test_xpath_paths_abbrev_w3c.cpp 7KB
test_memory.cpp 6KB
main.cpp 5KB
test.cpp 5KB
test_compact.cpp 4KB
allocator.cpp 4KB
test_unicode.cpp 3KB
load_stream.cpp 3KB
save_custom_writer.cpp 3KB
writer_string.cpp 3KB
load_memory.cpp 3KB
include.cpp 2KB
traverse_base.cpp 1KB
load_options.cpp 1KB
modify_base.cpp 1KB
save_options.cpp 1KB
traverse_predicate.cpp 1KB
xpath_query.cpp 1KB
text.cpp 1KB
xpath_variables.cpp 1KB
load_error_handling.cpp 1KB
xpath_error.cpp 898B
xpath_select.cpp 773B
save_subtree.cpp 766B
modify_add.cpp 742B
traverse_walker.cpp 740B
modify_remove.cpp 678B
save_declaration.cpp 661B
traverse_rangefor.cpp 657B
test_deprecated.cpp 630B
traverse_iter.cpp 605B
custom_memory_management.cpp 425B
test_header_only_2.cpp 412B
test_header_only_1.cpp 412B
fuzz_xpath.cpp 403B
save_file.cpp 333B
load_file.cpp 331B
save_stream.cpp 324B
fuzz_parse.cpp 298B
test_header_string_iostream.cpp 130B
test_version.cpp 100B
test_header_iostream_2.cpp 87B
test_header_iostream_1.cpp 87B
test_header_iosfwd_1.cpp 83B
test_header_string_1.cpp 83B
test_header_guard.cpp 83B
test_header_iosfwd_2.cpp 83B
test_header_string_2.cpp 83B
fuzz_parse.dict 2KB
fuzz_xpath.dict 706B
.gitattributes 20B
.gitignore 18B
pugixml.hpp 53KB
test.hpp 8KB
pugiconfig.hpp 3KB
helpers.hpp 2KB
writer_string.hpp 997B
allocator.hpp 200B
manual.html 677KB
quickstart.html 118KB
pugixml-config.cmake.in 579B
pugixml.pc.in 377B
premake4.lua 2KB
Makefile 3KB
README.md 3KB
LICENSE.md 1KB
SECURITY.md 312B
bug_report.md 216B
feature_request.md 115B
pugixml_airplay.mkf 101B
pugixml_compact.natvis 24KB
pugixml.natvis 3KB
pugixml.nuspec 2KB
project.pbxproj 6KB
vs2005_pch1.png 27KB
共 187 条
- 1
- 2
资源评论
五_谷_丰_登
- 粉丝: 5249
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
- 音乐展示网页、基于Stenography的图像数字水印添加与提取,以及基于颜色矩和Tamura算法的图像相似度评估算法py源码
- 基于EmguCV(OpenCV .net封装),图像数字水印加解密算法的实现,其中包含最低有效位算法,离散傅里叶变换算法+文档书
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功