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
3
votes
1 answer

Loading pugi::xml_document from std::cin fails when invoked in pipeline

Using pugixml 1.0 Loading an XML document from std::cin works when I use shell STDIN redirection: $ ./pugitest < sample.xml # OK But when invoked in a pipeline, it fails: $ cat sample.xml | ./pugitest # FAILS ./pugitest: Error reading from…
Pat
  • 1,726
  • 11
  • 18
2
votes
3 answers

PugiXML C++ getting content of an element (or a tag)

Well I'm using PugiXML in C++ using Visual Studio 2010 to get the content of an element, but the thing is that it stops to getting the value when it sees a "<" so it doesn't get the value, it just gets the content till it reaches a "<" character…
Grego
  • 2,220
  • 9
  • 43
  • 64
2
votes
1 answer

Unresolved externals while creating static lib which uses PugiXml

I'm writing a static library that uses PugiXml for xml parsing. Here is the linker output from Visual Studio 2010 (I've replaced the symbol with ellipses for readability): error LNK2019: unresolved external symbol "public: __thiscall…
2
votes
1 answer

How to construct a zip file with libzip

I try to create a compressed file and insert an xml file in it using two libraries (pugixml / libzip), everything goes without error, but when I open the xml file, the encoding at the beginning of the file is weird : Main.cpp : #include…
Al Tilmidh
  • 33
  • 5
2
votes
1 answer

how to convert pugi:char_t* to string?

Possible Duplicate: How to convert pugi::char_t* to string how can I convert pugi:char_t* type to wchar_t string? I want to compare the result of child_value() to some utf8 string and without that convertion I cant do that. for…
aliakbarian
  • 709
  • 1
  • 11
  • 20
2
votes
1 answer

Is there any MIT JSON parser with syntax similar to pugixml?

So I need to do JSON documents parsing. I already parse xml documents with pugixml and now I need to parse JSON documents with the same\similar rules as XML ones. Is there an opensourse (MIT or something similar) JSON parser with an API similar to…
Rella
  • 65,003
  • 109
  • 363
  • 636
2
votes
1 answer

XML parsing with PugiXML, infinite loop

this is pretty much the first C++ program that I ever made, it should display a list of xml nodes in the document. I made an exact same thing work using TinyXML, but I find Pugi much nicer and would like to continue using it. Program code: #include…
Dreen
  • 6,976
  • 11
  • 47
  • 69
2
votes
1 answer

Get line/column of an XPath query in Pugixml

We want to get the line/column of an xpath query result in pugixml : pugi::xpath_query query_child(query_str); std::string value = Convert::toString(query_child.evaluate_string(root_node)); We can retrieve the offset, but not the line/column…
Ghassen Hamrouni
  • 3,138
  • 2
  • 20
  • 31
2
votes
1 answer

Reading a list of xml nodes causes segmentation fault

I try to develop a package system for a game server engine i use, so, upon start i read a XML file and add the nodes to a list so i can use later. I can read the list after i created it, in same method. But when i try to read it from another file,…
KrisInception
  • 155
  • 2
  • 6
2
votes
2 answers

Qt undefined reference to `pugi::xml_document::xml_document()`

Recently I'm working on a project with Qt/C++/xml and some other stuff. I have to get some string values form a xml file. For that I'm using #include "pugixml.hpp". But when i'm using pugi::xml_document document; , it give an error as…
Champika
  • 65
  • 1
  • 11
2
votes
2 answers

Remove child nodes from parent - PugiXML

How can I remove child node of that has child node which has attribute id not starts with it using…
vincent911001
  • 523
  • 1
  • 6
  • 20
2
votes
2 answers

C++ pugiXML, Append a child before the first child in a node

How do you append a new child to a node and place it prior to the first child? i.e. I want to try and append a new child and push it to the top in order. Say, if I have: pugi::xml_node root; pugi::xml_node level1 =…
user5224720
2
votes
1 answer

Pugixml C++ Parsing boolean

Here is my problem: test.xml true false test.cpp sampgdk::logprintf("%d", config.get("server/a")); sampgdk::logprintf("%d",…
2
votes
1 answer

send/retrieve xml file to/from server cocos2d-x

My app saves all the data it needs onto an xml file that is stored on the device. When the user opens the app it pulls that xml file so they can keep their saved data. I want to be able to upload that xml file to a server, specifically by using a…
ctapp1
  • 556
  • 1
  • 5
  • 19
2
votes
0 answers

two projects using source of the same library twice

I have a library Lib and an executable App with the following file hierarchy: Lib/ - external/ - pugixml/ - pugixml.hpp -> namespace ``pugi`` and header guard ``LIBA_PUGIXML_HPP`` - pugixml.cpp App/ - external/ …
Gabriel
  • 8,990
  • 6
  • 57
  • 101
1
2
3
11 12