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
1
vote
2 answers

RapidXml: cannot get children from XML file

With the following C++ code, using the RapidXml library, I can only get XML elements at the top level, and not the children: char *text = ... // XML file shown below using namespace rapidxml; xml_document<> doc; doc.parse<0>(text); xml_node<> *node…
Pietro
  • 12,086
  • 26
  • 100
  • 193
0
votes
1 answer

Rapidxml cannot read Atom feed ? - Element XMLNS unbound

I have the following test xml:
Flaviu_
  • 1,285
  • 17
  • 33
0
votes
1 answer

Can't correctly open the next XML file in a loop while using RapidXML

I am trying to make a program that opens a list of XML files and recovers some data from them so I decided to use RapidXML. Everything is fine for the first document but after I try to open another file in a loop the program crashes because RapidXML…
0
votes
2 answers

RapidXML is throwing exception

ifstream fin("tree.xml"); if (fin.fail()) return 1; fin.seekg(0, ios::end); size_t length = fin.tellg(); fin.seekg(0, ios::beg); char* buffer = new char[length + 1]; fin.read(buffer, length); buffer[length] =…
ansrivas
  • 597
  • 2
  • 9
  • 14
0
votes
0 answers

C++11 Trouble accessing node by name with rapidxml::first_node

I am confused as to why I can find the node by name through next_sibling. But when I try to use first_node I am getting a segfault. The parent node containing all the nodes I need to find. rapidxml::xml_node<> *xmlnode_chd = xml_doc->first_node();…
French
  • 1
  • 1
0
votes
2 answers

getting nested values from a decoded SAMLresponse XML with rapidxml

I have been trying to get the values of the decoded XML, all 3 of them. The XML file is as follows (it has way more nodes but this is just a testing preview) check1 …
0
votes
2 answers

Warning C6386 - Buffer overrun while writing to 'LINES_DATA.Lines'

I know this question has been asked before, but I couldn't quite fix my code, even reading other topics. Does anyone know why is it throwing this warning? Warning C6386 Buffer overrun while writing to 'LINES_DATA.Lines': the writable size is…
Lucaaz
  • 1
0
votes
1 answer

rapidxml weird parsing for one specific node

I've been looking for hours a solution to my (simple ?) problem but I cannot find anyone who encountered this. I'm using latest version of rapidxml(1.13). I'm currently trying to create a tile-based engine and I need to read tmx file. I'm been using…
max a
  • 1
0
votes
1 answer

C++, RapidXML: Parse large files

I want to parse a large XML File (33000 lines). Following the structure of my xml file:
0
votes
0 answers

How to append new Child node to existing file using Rapidxml in c++

Below is my code to create an xml using Rapidxml. ... std::ofstream theFile(pathToCheck); xml_document<> doc; xml_node<>* root = doc.allocate_node(node_element, "ApplicationsDetails"); doc.append_node(root); …
Sid
  • 1
0
votes
1 answer

How to iterate an xml file and store it in map

How to iterate an file using rapidXml and store it in a map... Something like creating a dictionary using the contents of file. I have tried this but i can get only the first level of key-value pairs not the inner levels. typedef map
Chandan Shetty SP
  • 5,087
  • 6
  • 42
  • 63
0
votes
1 answer

RapidXML reading from file - what is wrong here?

What's the difference between these two methods of reading an input file? 1) Using 'ifstream.get()' and 2) Using a vector with ifstreambuf_iterator (less understood by me!) (other than the obvious answer of having nifty vector methods…
FlipMcF
  • 12,636
  • 2
  • 35
  • 44
0
votes
0 answers

Is possible to customize rapidxml use of line breaks and tabs in a C++ application?

I am using rapidxml to generate an XML in a C ++ application: xml_document<> doc; xml_node<>* dec1 = doc.allocate_node(node_declaration); dec1->append_attribute(doc.allocate_attribute("version", "1.0")); …
jstechg
  • 123
  • 1
  • 2
  • 10
0
votes
2 answers

How to read UTF-8 XML with RapidXML and use it with C++

I work on a C++ application and implemented a translator class that uses data from a XML file to translate strings. I have now serious problems with special characters currently for German Umlauts ÖÄÜ for example... On Visual Studio I see following…
Ziagl
  • 492
  • 2
  • 8
  • 22
0
votes
1 answer

RapidXML weird output

I'm currently trying to use RapidXML to write a file out, this is the code I've got for it xml_document<> doc; xml_node<>* decl = doc.allocate_node(node_declaration); decl->append_attribute(doc.allocate_attribute("version", "1.0")); …
Bob Willett
  • 26
  • 1
  • 5