Questions tagged [rapidxml]

A general purpose XML parser for C++ designed for execution speed and practical usage. It can also modify nodes and output a full xml document.

Rapidxml is a header-only XML parser with high usability, portability, and very good W3C compatibility.

  • no dependencies (except standard C++ library <cassert>, <cstdlib>, <new>, and <exception>
  • character type agnostic: supports narrow and wide, wchar_t UTF-16 and UTF-32, and UTF-8 if endianness is native
  • special memory pool object management for speed
  • not fully W3C compliant: ignores DOCTYPE declarations, and minor incompatibilities
  • robust and has a large unit test harness
  • easy to learn and use: begin writing useful parsing code in less than five minutes
  • license is Boost Software License or MIT License
  • stable since 2006
  • an additional header-only file adds the ability to stream out and format an xml document
  • other header classes simplify iterating through a document, loading from a file, and get child counts

Rapidxml is widely cross-platform compatible, its execution speed is proportional to the length of the XML data parsed, and it requires no configuration and no metadata or schema.

182 questions
0
votes
1 answer

Parsing several files (one by one) with rapidXML to use less memory

I need to read a big XML file (~5.4 GB). I noted that parsing the file with rapidXML uses about 6 times more RAM than the size of the file on disk (so parsing a 200 MB file requires ~1.2 GB of RAM and the 5.4 GB file would require ~32.4 GB of RAM…
Madsub
  • 58
  • 1
  • 6
0
votes
1 answer

RapidXML Exception

I'm trying to parse a response from another system that is in XML. I decided to use RapidXML as my parser. Everything was going fine until the system reported a "faultResponse" message. When trying to handle the "faultResponse" message I get a…
0
votes
2 answers

recursion problem in parsing with RapidXML/C++ class pointers side-effect

I want to share this odd but interesting situation I stumbled upon recently while trying to use RapidXML for XML parsing in C++. I wanted to write a recursive function to search and return a particular node among the children of a given node. My…
ascanio
  • 1,506
  • 1
  • 9
  • 18
0
votes
1 answer

Updating XML node & attribute values in C++ using RapidXML

I have an XML file which is being used for storing camera parameters which will get updated in response to changes from the UI. With RapidXML, I can read the XML file, all elements & their attribute values. However, when I try to update the value of…
0
votes
1 answer

Trying to append unique XML attributes to nodes using RapidXML

I want to append attributes to each node found in a root tag in an iterator, and I want the attribute to be id with indices assigned to them. Here is the block of code used for iterating over the child nodes, allocating and appending each attribute…
edition
  • 638
  • 14
  • 31
0
votes
1 answer

Get Comment in XML file by RapidXML

I try to get value of a command in xml file. I found the function type() on its manual. But it just return numberic value about type of node. Are there any ways to get it? This is my snippet: xml_node<> *Node = Doc.first_node(); xml_node<> *Sub =…
0
votes
1 answer

RapidXml fails to parse xml which has unicode containts

I am trying to parse xml which has Unicode chars but rapidxml is giving exception when I call parse function. Attaching code snippet. Note: Same code is able to parse ascii containt. bool ParseXmlData(const std::wstring &XmlData) { LPCTSTR…
simba
  • 11
  • 8
0
votes
3 answers

Trying to understand RapidXml memory allocation

I'm using RapidXml in a c++ program. Well ok no problem it works. I just do not understand why I must use pointers instead of variable values... If you take a look to the RapidXml wiki page, some examples are provided, this is the one provided by…
Andry
  • 16,172
  • 27
  • 138
  • 246
0
votes
0 answers

rapidxml parsing misbehavior when subfunction is used

everyone! I am using rapidxml to parse my setting file. When I do everything in a single function, it works well. But when I try to add some functions to do the work, it always give std::exception. Does anyone know the reason? A simple code example…
Y.J Wang
  • 1
  • 1
0
votes
1 answer

rapidxml parses just one whole node

I am using RapidXML to parse a string of xml. There is my string: std::string str("
Mert Mertce
  • 1,049
  • 7
  • 34
0
votes
1 answer

is there is any way to get xml value by tag in rapid xml using c++

is there is any way to get the value of tag by its tagname in rapidxml using c++ example example1 i need to get the book value ie example and book1 value ....we can use this…
raja
  • 109
  • 1
  • 2
  • 5
0
votes
2 answers

RapidXML XML parse error

I'm parsing an XML file which is quite simple: Gambardella, Matthew XML Developer's Guide
Joshua Noble
  • 830
  • 2
  • 12
  • 26
0
votes
3 answers

RapidXML accessing sibling nodes causes segfaults for seemingly no reason

So I recently got a hold of RapidXML to use as a way to parse XML in my program, I have mainly been using it as a way to mess around but I have been getting some very weird issues that I'm really struggling to track down. Try and stick with me…
0
votes
1 answer

bug of RapidXML when the value of a xml node is null

If the value of node in the xml is null, when we print the xml node, the node has no start tag, but only the end tag. For example: xml_document doc; doc.append_node(doc.allocate_node(rapidxml::node_element, "mynode", "")); ofstream…
gefu
  • 1
0
votes
1 answer

rapidxml using the where() function

How is it I use the where() function? using namespace rapidxml; xml_document<> doc; std:string xmlfile = "test.xml"; std::ifstream file ( xmlfile ); std::stringstream buffer; buffer << file.rdbuf ( ); file.close ( ); …
User666
  • 121
  • 1
  • 10