| 200 | } |
| 201 | |
| 202 | static void test2(void) |
| 203 | { |
| 204 | acl::xml body; |
| 205 | body.get_root().add_child("test", true) |
| 206 | .add_attr("mail", "\"zsxxsz1\" zsxxsz1@test.com") |
| 207 | .add_attr("title", "��<��>��\'��</test>���\"�����\\\"") |
| 208 | .add_attr("from", "\"zsxxsz2\" zsxxsz2@test.com"); |
| 209 | acl::string buf; |
| 210 | body.build_xml(buf); |
| 211 | printf("data: %s\r\n", buf.c_str()); |
| 212 | |
| 213 | printf("------------------------------------------\r\n"); |
| 214 | |
| 215 | acl::xml xml(buf.c_str()); |
| 216 | const acl::xml_node* node = xml.getFirstElementByTag("test"); |
| 217 | if (node == NULL) |
| 218 | printf("test tag null\r\n"); |
| 219 | else |
| 220 | { |
| 221 | const char* mail = (*node)["mail"]; |
| 222 | const char* title = (*node)["title"]; |
| 223 | const char* from = (*node)["from"]; |
| 224 | printf("mail: %s\r\n", mail ? mail : "null"); |
| 225 | printf("title: %s\r\n", title ? title : "null"); |
| 226 | printf("from: %s\r\n", from ? from : "null"); |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | static void get_html(const char* file) |
| 231 | { |
no test coverage detected
searching dependent graphs…