Questions tagged [pugixml]

Light-weight, simple and fast XML parser for C++ with XPath support

Overview(from official website)

pugixml is a light-weight C++ XML processing library. It features:

  • DOM-like interface with rich traversal/modification capabilities
  • Extremely fast non-validating XML parser which constructs the DOM tree from an XML file/buffer
  • XPath 1.0 implementation for complex data-driven tree queries
  • Full Unicode support with Unicode interface variants and automatic encoding conversions

The library is extremely portable and easy to integrate and use.

pugixml is developed and maintained since 2006 and has many users. All code is distributed under the MIT license, making it completely free to use in both open-source and proprietary applications.

Links

170 questions
1
vote
1 answer

Add XML contained in string as XML nodes to existing pugixml tree

I have a configuration file saver/loader. In addition to the expected data, there is a node. When saving the node, we'd simply have a std::string _customData and add it to the node, like this: pugi::xml_document doc; pugi::xml_node…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
1
vote
1 answer

pugixml getting same address for all the children at the same level

we are seeing that the address of all the children at the same level are the same, this is hurting our logic as we want to store the addresses of xml nodes for later processing. here is the sample xml we are using and the output. xml:
Ravikumar Tulugu
  • 1,702
  • 2
  • 18
  • 40
1
vote
1 answer

pugixml include dir set to not found from pugixml config cmake files

I am trying to compile this project: https://github.com/computationalpathologygroup/ASAP.git from source. Pugixml is a dependency I have built pugixml from source and set PugiXML_DIR and PUGIXML_INCLUDE_DIR And it still gives me error: "CMake…
aditya sista
  • 131
  • 1
  • 12
1
vote
2 answers

How to write a generic templated wrapper for type specific acess functions?

I'm trying to write a generic wrapper for the C++ pugi xml library that can save and store values to/from xml. They have implemented their xml node attributes' (stored as strings) access functions into functions such as attribute.as_int(),…
jpsalm
  • 328
  • 1
  • 8
1
vote
1 answer

Pass variable to PUGIXML xml_tree_walker

I am using pugixml to parse a file. I have been using an xml_tree_walker and I have a variable I want to modify as the walker walks through the xml. I am currently using a global variable but don't want to. Is there a way to pass a variable to the…
EngineerCamp
  • 661
  • 1
  • 6
  • 16
1
vote
1 answer

Compress data from pugixml

I'm trying to compress data from a pugi::xml_document. This is what I tried : template void save(const T &object, const QString &path) { pugi::xml_document doc; object.exportXML(doc); std::ostringstream stream; …
Louis Etienne
  • 1,302
  • 3
  • 20
  • 37
1
vote
1 answer

CMake and pugixml

I am new to CMake and having trouble understanding how to use it. I have a cross-platform c++ project. It builds using CMake and my CMakeLists.txt lives in a folder called MyProject along with the project. I checked out a pugixml git submodule and…
Valentin
  • 1,108
  • 8
  • 18
1
vote
1 answer

Change a node to be a comment node

I have a reference to an xml_node. Is there a way to change it to be a comment type node (node_comment)? Essentially to comment the node out.
ilya1725
  • 4,496
  • 7
  • 43
  • 68
1
vote
1 answer

pugi::next_sibling returned something strange

I have xml like this test test1 I use pugixml to parce…
1
vote
0 answers

catkin_make won't compile my packages..but

I am currently having problem with my package will not compile the headers if I catkin_make my catkin_workspace. But if I catkin_make --only-pkg-with-deps packakge it works fine? So why am i able to compile if only compile that one independent from…
Carlton Banks
  • 395
  • 1
  • 6
  • 25
1
vote
1 answer

Namespace usage in XML

I'm parsing XML using pugi xml, which is not a namespace-aware parser (see Using Boost to read and write XML files). I'm trying to figure out how much of an issue this might be, but the problem is I don't 100% understand what XML namespaces are used…
Adam
  • 8,752
  • 12
  • 54
  • 96
1
vote
1 answer

extracting paragraph in text tag using pugiXML

I'm using pugiXML in Xcode and am trying to get paragraphs that are embedded within the text tags. Language I'm using is C++. I do not think this is a duplicate because I've found answers for Visual Studio but not for Xcode and other questions deal…
sinIqIn
  • 37
  • 2
  • 10
1
vote
1 answer

PugiXML C++ Newline handling issue: '\n\n' becomes '\\n\\n'

Recently I have been using XML files for a localisation system for a game I am developing (which uses Cocos2d-X). I am using PugiXML to parse the XML localisation file. I have run into an issue when parsing English strings with newline (\n)…
1
vote
1 answer

Saving sub-tree of PUGI XML tree in a pugi xml_node

In a function, I use pugi to first load an XML file. I then traverse the child xml nodes of the tree and push some of the child xml nodes (objects of type xml_node) to a vector of xml_node. But as soon as I exit this function, the original XML tree…
nurabha
  • 1,152
  • 3
  • 18
  • 42
1
vote
1 answer

How to replace a nodes pcdata or text using pugixml

I am looking for an elegant solution to replacing a nodes pcdata using pugixml (version 1.6). For example, iterating through a node set and updating the child value to something. pugi::xpath_node_set nodes = document.select_nodes("//a"); for (auto…
user3102241
  • 487
  • 1
  • 7
  • 18