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

164 questions
14
votes
3 answers

pugixml number of child nodes

Does a pugixml node object have a number-of-child-nodes method? I cannot find it in the documentation and had to use an iterator as follows: int n = 0; for (pugi::xml_node ch_node = xMainNode.child("name"); ch_node; ch_node =…
lsdavies
  • 187
  • 1
  • 13
10
votes
2 answers

Build an xml tree from scratch - pugixml C++

Firstly I would like to say that I have been using an XML parser written by Frank Vanden Berghen and recently trying to migrate to Pugixml. I am finding the transition bit difficult. Hoping to get some help here. Question: How can I build a tree…
Sandeep
  • 1,157
  • 1
  • 10
  • 24
7
votes
3 answers

pugixml vs tinyxml

Short question: any comments on comparison of pugixml and tinyxml please? Details I need to use an XML parser/writer. My software is written in C++. It seems to me TinyXML and pugixml are both good options (RapidXML is good as well but its interface…
sw_eng
  • 129
  • 1
  • 2
  • 7
5
votes
1 answer

Deep copy of "xml_document" in pugixml "Clone"

I'm using pugixml library to read and write xml files. How can I do deep copy "Clone" to the xml_document object in pugixml library?
user2179256
  • 481
  • 2
  • 6
  • 20
5
votes
2 answers

pugixml - get all text nodes (PCDATA), not just the first

Currently, if I try to parse First bit of text Second bit of text I only get First bit of text with parent.text().get() What's the correct way to grab all text nodes in parent? Is there a nice…
jozxyqk
  • 14,520
  • 8
  • 69
  • 153
4
votes
1 answer

Convert pugixml's result.offset to column/line

I need user-friendly error reporting for an application that uses pugixml. I am currently using result.offset. Is there a way to get the line and column instead? I am potentially dealing with large XML files, if that makes a difference.
Sam Washburn
  • 1,721
  • 2
  • 19
  • 38
4
votes
2 answers

HTML parsing using pugixml or an actual HTML parser

I'm interested in using pugixml to parse HTML documents, but HTML has some optional closing tags. Here is an example: Pugixml stops reading the HTML as soon as it encounters a…
Kiril
  • 37,748
  • 29
  • 161
  • 218
3
votes
2 answers

pugixml "extend" element to add value

I trying to set the value of an element, regulary when the element looks like this I just do this : pugi::xml_node node = xmlBase.child("element"); pugi::xml_node nodechild =…
Tistatos
  • 621
  • 1
  • 6
  • 16
3
votes
1 answer

Removing child node in a XML file C++

I am using PugiXml library for XML related operations. My XML File:
skm
  • 4,300
  • 7
  • 35
  • 82
3
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
  • 2,878
  • 2
  • 17
  • 31
3
votes
0 answers

Pugixml node line number

Is it possible to get line number from xml_node in pugixml? e.g. It should return '3' for "test".
DejaVu
  • 155
  • 8
3
votes
1 answer

moving (not copying) nodes using pugixml and rapidxml

I am looking for an XML library that supports a DOM interface. Performance is important for me so I was currently looking at rapidxml and also pugixml. The thing is that my application needs to modify the DOM tree, including moving nodes. And I…
user1192525
  • 657
  • 4
  • 18
3
votes
2 answers

Preserve empty text tags with pugixml

I'm trying to use pugixml to modify xml configuration, created through boost::serialization and used by other application so i need to change only few fragments of document and leave all other parts the same. Some nodes may store empty strings in…
magras
  • 1,473
  • 16
  • 29
3
votes
2 answers

Appending existing xml_node into another one using pugixml

How to append an exsiting pugi::xml_node into another one using pugixml ? the only function that i know is : pugi::xml_node node = root.append_child("child");
Mouhamed Fakarovic
  • 231
  • 1
  • 4
  • 10
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,078
  • 9
  • 37
  • 60
1
2 3
10 11