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.

177 questions
0
votes
2 answers

rapidxml comparing node values (testing values)

Im new to radidxml, I cant find a way to compare a node value to string. The only way I can figure out is to print it to a string, then test that value. if (cell_node->first_node("text:p")) { std::string test; print(test.begin(),…
bryan sammon
  • 6,441
  • 12
  • 35
  • 44
0
votes
4 answers

!strcmp as substitute for ==

I'm working with rapidxml, so I would like to have comparisons like this in the code: if ( searchNode->first_attribute("name")->value() == "foo" ) This gives the following warning: comparison with string literal results in unspecified behaviour…
Innkeeper
  • 623
  • 1
  • 9
  • 21
0
votes
0 answers

Parsing an XML tree with RapidXML and discarding unwanted nodes

I am interested in using RapidXML to parse an XML tree; however, this XML has several layer of rows that I do not need. This is because it is a representation of a genetic tree and many layers are called "clade" which is essentially useless info to…
Jon Claus
  • 2,543
  • 4
  • 17
  • 29
0
votes
1 answer

Parsing XML inOrder C++

This is related to one of my previous questions. I'm trying to build a tree from an xml file. I plan to go through the xml file and create objects out of the data and create a vector of the objects in preorder and inorder so that I can construct the…
user2067100
0
votes
1 answer

Compiling errors using RapidXML in C++ using Dev C++

I am parsing an XML file for my C++ project in Dev C++ and I have the following code in the rapidxml_iterators.hpp file: typedef xml_node value_type; typedef xml_node &reference; typedef xml_node *pointer; typedef typename std::…
0
votes
2 answers

C++ RapidXML get sibling of the same type?

So, in RapidXML, I'm trying to loop through my file to get the data from some tileset nodes: rapidxml::xml_node<> *root_node = doc.first_node("map"); for(rapidxml::xml_node<> *tileset = root_node->first_node("tileset"); tileset != 0; tileset =…
user569322
0
votes
1 answer

How to read information from a XML file c++

Possible Duplicate: rapidxml: how to iterate through nodes? Leaves out last sibling Im trying to reas some information from a XML file using rapidXML but cant get it to work. The XML file looks like this:
Tobias
  • 65
  • 6
0
votes
3 answers

Rapidxml: adding subtree directly as value

I'm trying to append a very big subtree using rapidxml in a dirty way, exploiting the value method rapidxml::xml_node<>* node = allocate_node(rapidxml::node_element, "tree"); node->value(""); but it but…
Cavaz
  • 2,682
  • 19
  • 33
0
votes
1 answer

rapidXML parsing misbehavior

I'm trying to parse a xml file: test.dat 5 4 10 main: int _tmain(int argc, wchar_t* argv[]) { std::string SettingsFile…
user238801
0
votes
2 answers

RapidXML NULL Pointer

I'm getting values of my config file with rapidXML in a kindly bad way. xml_document<> doc; doc.parse(buffer); int a = atoi(doc.first_node("master")->first_node("profile")->first_node("width")->value()); If the node doesn't exist…
Naster
  • 1,153
  • 1
  • 14
  • 25
0
votes
1 answer

Storing class members as RapidXML data types

I'm having an issue with storing member variables that are of RapidXML datatypes. I also experience this problem with member functions' return types. Only in the class' file header to I experience this issue. Using these datatypes within functions…
hrr4
  • 3
  • 2
0
votes
1 answer

Weird result with rapidXml in C++ append_node

I have this class: // XmlWrapper.h class XmlWrapper{ private: xml_document<> doc; public: XmlWrapper(); string addNode( string node_name); string getXmlString(); }; //…
Kingfisher Phuoc
  • 7,392
  • 8
  • 43
  • 75
0
votes
2 answers

Error while parsing Japanese Kanji with RapidXml

I have a problem when I try to parse a xml file containing a specific Kanji: 退 After debugging, I see that the problem is in this function of RapidXml : struct text_pure_no_ws_pred { static unsigned char test(Ch ch) { return…
Rodrigue Rens
  • 237
  • 3
  • 7
0
votes
1 answer

Error while parsing a Xml file with RapidXML

I have a "parse_error" when I try to parse an xml file containing a specific Japanese kanji: 退 If I change this Kanji to another, the parsing works well. Any idea? PS: I parse the file with rapidXML Here is a sample of the xml file:
Rodrigue Rens
  • 237
  • 3
  • 7
0
votes
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
  • 10,628
  • 22
  • 80
  • 165
1 2 3
11
12