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

RapidXML (C++): Accessing text within node but outside child-node

XML: Lorem ipsum dolor TEXT TO BE ACCESSED sed do eiusmod tempor etc. This is read into an rapidxml::xml_document<> and parsed with the flag…
Nicolai
  • 11
  • 2
1
vote
2 answers

Proper choice of file stream objects

Application uses RapidXML to edit XML file. Editing is not automated and takes place occasionally: XML content is displayed in GUI and user performs some actions which change XML. Each change must be saved to disk immediately. Loading RapidXML…
Bojan Komazec
  • 9,216
  • 2
  • 41
  • 51
1
vote
2 answers

RapidXML throwing a parse_error exception

When I try to parse a simple .xml file using the RapidXML framework, it throws a parse_error with this cause: "expected <". Now this is practically my first time writing XML code, so it might be a silly syntax error, in that case, bear with me…
Benjamin
  • 541
  • 1
  • 9
  • 17
1
vote
0 answers

rapidxml first_attribute registering a '/' as a '}'

Okay so I have to be missing something pretty obvious but I have yet to find cause of this issue. I have a xml file that contains information about a systems units. Originally, I was saving the units in another location of the file and parsing the…
JCoder
  • 75
  • 5
1
vote
2 answers

RapidXML node has correct value in try catch block, but it's nullptr outside the block

This might be more of a c++ problem rather than a rapidxml problem, and I'm still learning c++ so sorry if this is a very stupid question. I am trying to load an XML file within a try block: rapidxml::xml_document<> doc; rapidxml::xml_node<>*…
devobvious
  • 11
  • 1
1
vote
2 answers

How to add RapidXml to a CMake Project?

I want to add RapidXML to my CMake Project, so i can use it. My Project Structure looks like this: Root | |_inc (for my own Headers) | |_main.h | |_CMakeList.txt |_src (for my own Sources) | |_main.cpp | |_CMakeList.txt |_libs (for third…
Limatuz
  • 666
  • 2
  • 6
  • 12
1
vote
1 answer

How to parse an XSD file with RapidXML

Does RapidXML have the capability to validate/parse a XML file with its associated schema, i.e. XSD file? I was under the assumption that an XML parser would have the capability to do both congruently. If not, why is it deemed unnecessary to…
1
vote
1 answer

write to XML with RapidXML

I am trying to read my vector with tuple and parse it in to a xml file. The writing to the XML file works but he only write the values of the last node. So i get only the same values all time. I found that after the for loop he loosing all existing…
Julian K.
  • 37
  • 1
  • 6
1
vote
1 answer

c++ rapidxml cant use saved xml_document properly

i'm trying to parse some xml string to an xml_document, and save the xml_document to a variable for further usage. Directly after the parsing the xml_document is useable, but i cant access it from another method. Heres the example code: XML.h // //…
Artur
  • 58
  • 5
1
vote
1 answer

No leaks from rapidxml

Today I was trying to find memory leaks from my project then I came across the below sample code std::string VersionValue("1.0"); std::string EncodingValue("UTF-8"); rapidxml::xml_document<> XMLDoc; rapidxml::xml_node<> * pHeaderNode =…
Gilson PJ
  • 3,443
  • 3
  • 32
  • 53
1
vote
0 answers

How to get the content of the tag by using references idref in xml

here is my code. taxi taxi
1
vote
2 answers

Rapidxml is not compiling on Visual Studio 2010. What am I doing wrong?

I am working on switching XML parsers from TinyXml to RapidXml in our codebase. However, RapidXml does not seem to compile with Visual Studio 2010. Basically, in the header file I am doing #define RAPIDXML_NO_EXCEPTIONS #include…
bastibe
  • 16,551
  • 28
  • 95
  • 126
1
vote
0 answers

Delete a node by rapidxml without deleting its subnode

hanhao 18 e.g. I want to delete the "top" node,at the same time ,remain its subnode "name" and "value" and…
Aaron Hao
  • 59
  • 8
1
vote
1 answer

Rapidxml traversing nodes

the xml file: hanhao 18 my cpp…
Aaron Hao
  • 59
  • 8
1
vote
2 answers

Add number (double/float) as attribute to RapidXML node

I'm pretty new to RapidXML. I want to construct an Xml document and print it to a file. Everything works but I'm not sure if I'm doing one part of the process right: Adding an attribute to a node that is a double. I'm using std c++ stuff: double…
Oliver Zendel
  • 2,695
  • 34
  • 29