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

Attempting to read nodes in Rapid XML resulting in error

I have a class in my program that uses Rapid XML to write data to file. This process works fine. However when I attempt to read the same data, my program will always be halted by internal error catching code, explaining "next sibling returned NULL…
Alister
  • 453
  • 6
  • 15
0
votes
1 answer

how to get child xml block as text using rapidxml

I want to get child xml block as text. Example. My xml like this; .... John 17 .... How to get John 17 as text.... Thanks...
aphelix
  • 29
  • 1
  • 4
0
votes
1 answer

conversion from stringstream to string removes '=' characters

I am reading an XML file into a stringstream buffer in order to parse it using RapidXML. RapidXML is only parsing the names of the XML nodes, but none of their attribute names or values. After some experimentation, I discovered that the problem is…
Jeff C.
  • 11
  • 2
0
votes
1 answer

Calling this method from other class creates violation reading

I am trying to create a configuration class which reads the data from an xml with rapidxml. Therefore I have a private xml_document which I parse inside of the constructor: class Config { public: Config(); ~Config(); /*returns the first…
bemeyer
  • 6,154
  • 4
  • 36
  • 86
0
votes
1 answer

find child element with rapid xml

I try to get the child element of an simple xml but it does not work correct. I get Runtime exception: Access violation reading location 0x0000000. I simply try to access it like this: Config::Config() { rapidxml::file<> xmlFile("config.xml"); …
bemeyer
  • 6,154
  • 4
  • 36
  • 86
0
votes
2 answers

RapidXML loading xml files

I cannot return the loadings from the xml. Here is the code: RapidXML xml loader vector ParseFanbeamGeometry(char* fileName) { xml_document<> doc; xml_node<> * root_node; // Read the xml file into a vector ifstream theFile…
Ono
  • 1,357
  • 3
  • 16
  • 38
0
votes
2 answers

Read XML node with RapidXML

I'm using RapidXML to parse XML files and read nodes content but I don't want to read values inside a node, I need to read the content of specific XML nodes "as XML" not as parsed values. Example : < .... > …
Ozon3
  • 25
  • 3
0
votes
2 answers

RapidXml - buffer overflow on parsing char *

I am trying to create a member function for setting up a rapidxml::xml_document<> object from a string, the overloaded ones for std::string, const std::string and const char * work fine. When I try to load the char * directly, I get a buffer…
tempanon
  • 3
  • 2
0
votes
2 answers

RapidXML - How to open XML file from server location?

I'm having trouble reading an xml file from a server location. When the file is opened locally on the computer, it appears to work fine. However, when the file is opened from a location on a server, it does not work. Do you know what the problem may…
code
  • 5,294
  • 16
  • 62
  • 113
0
votes
0 answers

RapidXML / C++ - parsing into a static class member

I have a class with a rapidxml::xml_document, but when I try to parse XML into it, it populates with... well, not garbage, but information about my namespaces and the like. In the code below I have examples of what I've tried, commented out, and a…
technorabble
  • 391
  • 7
  • 16
0
votes
1 answer

RapidXML attribute value errors

I have used RapidXML in the past with few problems but this one has me stumped. I am creating a log of application event timestamps which an external program can read in an replay any audio which occured in the origional application at the correct…
0
votes
3 answers

How do right read file via stdio? C++

I want to read file via stdio for RapidXML. I used following: #include #include #include #include using namespace rapidxml; int main(int argc, char** argv) { FILE *pFile; pFile =…
Ivan
  • 992
  • 1
  • 10
  • 22
0
votes
1 answer

RapidXML Parsing stuck on first node C++

When I run this it prints x: 400 Next: y continuously. Why doesn't it go to the next sibling when it repeats? I'm following an example from the RapidXML manual so it should work. data.xml 400
Calvin Koder
  • 953
  • 2
  • 7
  • 12
0
votes
1 answer

Segmentation Fault when using RapidXML

When I run this it prints XML loaded and Dimensions loaded and then prints Segmentation Fault (core dumped). I copied an example I saw in the manual for RapidXML and a similar example was given on StackOverflow. Whats wrong with my…
Calvin Koder
  • 953
  • 2
  • 7
  • 12
0
votes
1 answer

RapidXML android ndk trouble parsing document

I'm having trouble compiling this for android: string buffer = readString(m_paths[SCREEN]); if (buffer != "") { //Read full buffer xml_document<> doc; doc.parse<0>((char*)buffer.c_str()); } It works well on VS2010 but for some reason…
Netwave
  • 40,134
  • 6
  • 50
  • 93