| 267 | } |
| 268 | |
| 269 | static ACL_XML_NODE *test_getElementById(ACL_XML *xml, const char *id) |
| 270 | { |
| 271 | ACL_ITER iter1; |
| 272 | ACL_XML_NODE *node = acl_xml_getElementById(xml, id); |
| 273 | |
| 274 | printf("--------------- acl_xml_getElementById ---------------\r\n"); |
| 275 | if (node == NULL) { |
| 276 | printf(">>>id: %s not found\r\n", id); |
| 277 | return NULL; |
| 278 | } |
| 279 | |
| 280 | printf("tag-> %s, text: %s\n", STR(node->ltag), STR(node->text)); |
| 281 | |
| 282 | /* ������ xml �������� */ |
| 283 | acl_foreach(iter1, node->attr_list) { |
| 284 | ACL_XML_ATTR *attr = (ACL_XML_ATTR*) iter1.data; |
| 285 | printf("\tattr_name: %s, attr_value: %s\n", |
| 286 | STR(attr->name), STR(attr->value)); |
| 287 | } |
| 288 | |
| 289 | printf("----------- the id2_2's next node is ------------\n"); |
| 290 | |
| 291 | node = acl_xml_node_next(node); |
| 292 | |
| 293 | if (node) { |
| 294 | printf("-------------- walk node ----------------\n"); |
| 295 | |
| 296 | /* ������ xml �������� */ |
| 297 | acl_foreach(iter1, node->attr_list) { |
| 298 | ACL_XML_ATTR *attr = (ACL_XML_ATTR*) iter1.data; |
| 299 | printf("\tattr_name: %s, attr_value: %s\n", |
| 300 | STR(attr->name), STR(attr->value)); |
| 301 | } |
| 302 | |
| 303 | } else |
| 304 | printf("-------------- null node ----------------\n"); |
| 305 | |
| 306 | printf("Enter any key to continue ...\r\n"); |
| 307 | getchar(); |
| 308 | |
| 309 | return node; |
| 310 | } |
| 311 | |
| 312 | static void parse_xml_benchmark(int once, int max, const char *data) |
| 313 | { |
no test coverage detected
searching dependent graphs…