if i have xml content
<aaa> 1111<bbb>222</bbb>333 </aaa>
Then how to get value which is "1111" and "333"
but I only can get value of first node which is "1111" only
Please advise
code is here
#include <iostream>
#include "rapidxml/rapidxml.hpp"
#include <string.h>
using namespace std;
using namespace rapidxml;
string content = "<aaa> 1112<bbb>222</bbb>333 </aaa>";
int main(int argc, char**argv) {
xml_document<> m_doc;
try {
m_doc.parse<0>(&content[0]);
} catch (rapidxml::parse_error &error) {
cout <<"parse_error\n";
exit(1);
}
xml_node<>* node = m_doc.first_node();
cout << "name = " <<node->name()<<endl;
cout << "value = "<< node->value() <<endl;
cout << "value_size = "<< node->value_size()<<endl;
m_doc.clear();
return 0;
}
Output is
name = aaa
value = 1111
value_size = 5