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

write to an xml file using rapidxml in c++

#include "rapidxml-1.13/rapidxml.hpp" #include "rapidxml-1.13/rapidxml_print.hpp" #include "rapidxml-1.13/rapidxml_utils.hpp" #include #include using namespace std; using namespace rapidxml; int main() { std::ofstream…
2
votes
3 answers

compile rapidxml under linux with g++

The following simple program can't be compiled with gcc 4.4.3 #include "rapidxml.hpp" #include "rapidxml_utils.hpp" #include "rapidxml_print.hpp" #include "rapidxml_iterators.hpp" int main() { return 0; } Compile produces following…
Boris
  • 21
  • 3
2
votes
2 answers

Cloning rapidxml::xml_document

How do I get a complete copy of a RapidXML xml_document? There is a clone_node function; how to use to to create a complete copy of an existing document?
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
2
votes
1 answer

c++ bass and rapidXml on Raspberry Pi 1 B

I have a strange behaviour on a project that I am doing for my kids. I want to parse an xml with rapidXml and play mp3 with bass on my RasPi1B. Everything works fine if I just press it in one main-function. But as soon as I put the code into another…
2
votes
3 answers

Why does MapViewOfFile return an unusable pointer for rapidxml?

As suggested: I have a file which is larger than 2 giga. I am mapping to memory using the following function: char* ptr = (char*) MapViewOfFile( map_handle, FILE_MAP_WRITE | FILE_MAP_READ, 0, 0, 0 ); I parse ptr to rapidxml which accepts…
user378405
  • 21
  • 3
2
votes
0 answers

Convert xml file content to string using RapidXML

I am using RapidXML to modify an existing XML doc. This is my code: file<> xmlFile( launchFullPath.c_str() ); xml_document<> doc; doc.parse<0>(xmlFile.data()); // create a node called basedir xml_node<> *basedir =…
ManiAm
  • 1,759
  • 5
  • 24
  • 43
2
votes
1 answer

RapidXML: "expected <" error at end-of-file related to whitespace bug?

I created a C++ application that reads in XML files with the RapidXML parser. At one XML file that was shaped exactly the same as another one that worked, the parser threw an error: "expected <" The last five characters before the error were from…
Sam
  • 251
  • 1
  • 19
2
votes
2 answers

RapidXML Access individual attribute value using the previous attribute value?

I am using rapidXML and C++ in VS2012 on PC. I have already parsed the XML file, but now I want to print out attribute values individually. I am usually able to do this using the code below. This method, however, needs to know the node name and…
Ty Roderick
  • 51
  • 2
  • 3
2
votes
1 answer

How would I make this valid xml?

([\n](.)*)*
"> I need to parse this with rapidxml, and I cannot seem to escape those inner quotes with a backslash. How can I make this valid?
Innkeeper
  • 663
  • 1
  • 10
  • 22
2
votes
3 answers

How do I read nested xml using rapidxml

I am trying to use RapidXML to parse xml content that looks like this:
John Schroeder
  • 85
  • 1
  • 10
2
votes
0 answers

RapidXml attribute 100 character limit

I am trying to parse an .x3d document using RapidXml. Unfortunately, it only gives me the first 100 characters of any node attribute. I looked through the documentation, and it looks like there shouldn't be any limit on attribute value length. I'm…
2
votes
1 answer

Rapidxml is writing wrong characters

I've been using Rapidxml lately and have faced following problem. When I try to add attributes, which are not hardcoded, but generated during program runtime rapidxml inserts wrong characters. Here is my sample of code: void…
unresolved_external
  • 1,930
  • 5
  • 30
  • 65
2
votes
3 answers

RapidXML weird parsing

I have a very annoying problem and I'm trying to solve it for lots of hours. I'm using rapidXML with C++ to parse an XML file: xml_document<> xmlin; stringstream input; //initialized somewhere…
Daniel
  • 2,318
  • 2
  • 22
  • 53
2
votes
1 answer

Maybe bug in rapidxml - but I'm not sure how to fix

I noticed the rapidxml parses illegal < to an element named ? \0) What I…
ModdyFire
  • 706
  • 3
  • 9
  • 19
2
votes
0 answers

strcpy crashes on larger sizes (iPhone using rapidXML)

I'm following the tutorials for rapidxml on iOS5 and unfortunately my c is a little rusty. The following code works great for smaller char sizes but crashes with EXC_BAD_ACCESS when I pull down larger sizes (I'm pulling XML off of a RESTful…
Onjuku
  • 71
  • 4
1 2
3
12 13