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

c++ bass and rapidXml on Raspberry Pi 1 B

I have a strange behaviour on a project that I am doing for my kids. I want to parse an xml with rapidXml and play mp3 with bass on my RasPi1B. Everything works fine if I just press it in one main-function. But as soon as I put the code into another…
2
votes
3 answers

Why does MapViewOfFile return an unusable pointer for rapidxml?

As suggested: I have a file which is larger than 2 giga. I am mapping to memory using the following function: char* ptr = (char*) MapViewOfFile( map_handle, FILE_MAP_WRITE | FILE_MAP_READ, 0, 0, 0 ); I parse ptr to rapidxml which accepts…
user378405
  • 21
  • 3
2
votes
0 answers

Convert xml file content to string using RapidXML

I am using RapidXML to modify an existing XML doc. This is my code: file<> xmlFile( launchFullPath.c_str() ); xml_document<> doc; doc.parse<0>(xmlFile.data()); // create a node called basedir xml_node<> *basedir =…
ManiAm
  • 1,597
  • 4
  • 20
  • 41
2
votes
1 answer

Does RapidXML support xml:space="preserve"?

I'm reading an XML file where I have "whitespace-only text nodes":

I love Mozart.

In the above (simplified) example, there is whitespace (a single space) between the end tag and the start tag. I need to preserve that…
SMGreenfield
  • 1,515
  • 15
  • 27
2
votes
2 answers

RapidXML Access individual attribute value using the previous attribute value?

I am using rapidXML and C++ in VS2012 on PC. I have already parsed the XML file, but now I want to print out attribute values individually. I am usually able to do this using the code below. This method, however, needs to know the node name and…
Ty Roderick
  • 41
  • 1
  • 3
2
votes
1 answer

How would I make this valid xml?

([\n](.)*)*
"> I need to parse this with rapidxml, and I cannot seem to escape those inner quotes with a backslash. How can I make this valid?
Innkeeper
  • 623
  • 1
  • 9
  • 21
2
votes
3 answers

How do I read nested xml using rapidxml

I am trying to use RapidXML to parse xml content that looks like this:
2
votes
0 answers

RapidXml attribute 100 character limit

I am trying to parse an .x3d document using RapidXml. Unfortunately, it only gives me the first 100 characters of any node attribute. I looked through the documentation, and it looks like there shouldn't be any limit on attribute value length. I'm…
2
votes
3 answers

RapidXML weird parsing

I have a very annoying problem and I'm trying to solve it for lots of hours. I'm using rapidXML with C++ to parse an XML file: xml_document<> xmlin; stringstream input; //initialized somewhere…
Daniel
  • 1,453
  • 13
  • 33
2
votes
1 answer

Maybe bug in rapidxml - but I'm not sure how to fix

I noticed the rapidxml parses illegal < to an element named ? \0) What I…
ModdyFire
  • 618
  • 2
  • 9
  • 18
2
votes
2 answers

Prevent expansion of quotes and other special characters when printing XML using RapidXML

I am using RapidXML to read an XML file, parse it, do some operation and write it back. Any text written in quotes within tag, is printed with quotes in expanded form. Is there any flag that will prevent expansion of quotes and other special…
2
votes
0 answers

strcpy crashes on larger sizes (iPhone using rapidXML)

I'm following the tutorials for rapidxml on iOS5 and unfortunately my c is a little rusty. The following code works great for smaller char sizes but crashes with EXC_BAD_ACCESS when I pull down larger sizes (I'm pulling XML off of a RESTful…
Onjuku
  • 71
  • 4
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
  • 8,186
  • 2
  • 33
  • 48
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
  • 531
  • 1
  • 7
  • 17
1
vote
1 answer

C++ RapidXml - Traversing with first_node() to modify the value of a node in an XML file

I must be going crazy here... Here is my XML file, called Original.xml: Trying to change this Greek Caesar I am trying to modify the contents within the metadata tag. Here…
FriskySaga
  • 161
  • 3
  • 11
1 2
3
11 12