File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/request_body_processor Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,10 @@ class MSCSAXHandler {
7171 xml_data->nodes [xml_data->nodes .size ()-1 ]->has_child = true ;
7272 }
7373 xml_data->currpath .append (name);
74+ // set the current value empty
75+ // this is necessary because if there is any text between the tags (new line, etc)
76+ // it will be added to the current value
77+ xml_data->currval = " " ;
7478 }
7579
7680 void onEndElement (void * ctx, const xmlChar *localname) {
@@ -92,13 +96,17 @@ class MSCSAXHandler {
9296 }
9397 xml_data->nodes .pop_back ();
9498 xml_data->node_depth --;
99+ xml_data->currval = " " ;
95100 }
96101
97102 void onCharacters (void *ctx, const xmlChar *ch, int len) {
98103 XMLNodes* xml_data = static_cast <XMLNodes*>(ctx);
99104 std::string content (reinterpret_cast <const char *>(ch), len);
100105
101- xml_data->currval = content;
106+ // libxml2 SAX parser will call this function multiple times
107+ // during the parsing of a single node, if the value has multibyte
108+ // characters, so we need to concatenate the values
109+ xml_data->currval += content;
102110 }
103111};
104112
You can’t perform that action at this time.
0 commit comments