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

RapidXML Parse XML in Depth First mode

I am trying to parse a large XML File (1.8 GB) using RapidXML in C++. While I can get the children of any specific node using the following method : for(xml_node<> *child = node->first_node(); child; child = child->next_sibling()) { ... } I cant…
Koustuv Sinha
  • 1,640
  • 19
  • 34
0
votes
1 answer

xml to json conversion c++

I'm developing a C++ (visual studio 2005) app which converts xml to json I'm using rapidxml and rapidjson libraries. XML Gambardella, Matthew XML Developer's…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/c++" class="post-tag grid--cell" title="show questions tagged 'c++'" rel="tag">c++</a> <a href="../../questions/tagged/json" class="post-tag grid--cell" title="show questions tagged 'json'" rel="tag">json</a> <a href="../../questions/tagged/xml" class="post-tag grid--cell" title="show questions tagged 'xml'" rel="tag">xml</a> <a href="../../questions/tagged/rapidxml" class="post-tag grid--cell" title="show questions tagged 'rapidxml'" rel="tag">rapidxml</a> <a href="../../questions/tagged/rapidjson" class="post-tag grid--cell" title="show questions tagged 'rapidjson'" rel="tag">rapidjson</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Mar 17 '16 at 13:25">asked Mar 17 '16 at 13:25</time> <a href="../../users/2551701/boukeri-besmen" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/2551701.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="BOUKERI Besmen" /> </a> <div class="s-user-card--info"> <a href="../../users/2551701/boukeri-besmen" class="s-user-card--link">BOUKERI Besmen</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">13</li> <li class="s-award-bling s-award-bling__bronze" title="8 bronze badges">8</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-35878686"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>0</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/35878686/rapidxml-selecting-a-first-attribute-value" class="question-hyperlink">RapidXml: Selecting a first_attribute value</a></h3> <div class="excerpt">I am a starter in RapidXml. <catalog> <book id="bk101" value="ABCDEFGHIJKLMNOPQRSTUVWXYZ"> <author>Gambardella, Matthew</author> <title>XML Developer's Guide Computer 44.95
Shahparan
  • 5
  • 2
0
votes
1 answer

Reading out XML serves unexpected output in C++

I have a question about reading from a XML file. My XML File:
Bilzard
  • 371
  • 1
  • 5
  • 19
0
votes
1 answer

Removing RapidXML newlines & whitespace in output

How can I prevent RapidXML from adding tabs and newlines between element tags when calling the print(...) function to output XML?
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
0
votes
1 answer

Getting duplicate node values when parsing XML file using RapidXML

I need to read a simple XML file using RapidXML. I've loaded the XML file into a string variable and passed it to the parser. I need to get all nodes names and values, if those exist. My problem is that the following values end up as…
wojtek
  • 3
  • 2
0
votes
1 answer

Parsing XML file with RapidXML - only parsing first line of files

I am having trouble with RapidXML only parsing the first line of my file (or so it appears). When I feed in a sample file, it merely gets the first node (“map”) and nothing else. I set a breakpoint in Xcode after the parsing to inspect the result…
Cody
  • 15
  • 5
0
votes
1 answer

How check empty tag in xml with RapidXML c++

Exists XML: 0.000 - 0.000 0 1 42212.713495
Stan Zeez
  • 1,138
  • 2
  • 16
  • 38
0
votes
1 answer

Rapidxml writing memory error

I don't undestand why, while BBBString has a different content for every (i,j), on the xml the node "BBB" has always the same value (corresponding to the last couple (i,j) ). The other nodes have the exact content! for (unsigned short int i = 0; i <…
user1403546
  • 1,680
  • 4
  • 22
  • 43
0
votes
0 answers

Error while parsing xml file in cpp using Rapidxml

I am trying to read and xml file and parsing it using the below code can somebody suggest what mistake I am making. It shows the error Error: (E549) uncaught exception: ConfigException: expected < void ParserCnfFile::read(void) { ifstream…
0
votes
0 answers

Rapidxml causing a "Stack Smashing detected" error when calling next_sibling()

So, I'm parsing this xml: centered 300 Button toggleOption no
0
votes
1 answer

Find a line (and column) of xml_node in rapidxml

From what I could understand in the docs I deducted every xml_node knows it's position in the source text. What I'd like to do is to retrieve LINE and COLUMN for given xml_node<>*: rapidxml::file<> xmlFile("generators.xml"); // Open file,…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
2 answers

Rapidxml how to change the tag format when outputting an empty element

I use the rapidxml library to read/parse the content from a xml file, make some changes in the dom's content and then save the dom to the file again. When I save the contents of the xml_document to the file, the elements which contain an empty…
Adi Fatol
  • 956
  • 15
  • 24
0
votes
1 answer

Compiler won't let me return a rapidxml::xml_document, and reports errors in the header file

Compiling my three-file program (main.cpp, source.cpp, header.hpp) generates these errors: source.cpp: In member function ‘rapidxml::xml_document<> MyClass::generate_xml_document()’: source.cpp:559:9: error: use of deleted function…
EMBLEM
  • 2,207
  • 4
  • 24
  • 32
0
votes
1 answer

RapidXml Work when build but have problems in debugger

Hi i use rapidxml to load map in my game this is how my class for loading looks like it's normally compiling but when loading file sometimes it crashing so i wanted to debug it but debugger dont like my function which is setting pointers to data in…
davido132
  • 1
  • 1