| 379 | } |
| 380 | |
| 381 | static ACL_XML3_NODE *test_getElementById(ACL_XML3 *xml, const char *id) |
| 382 | { |
| 383 | ACL_ITER iter1; |
| 384 | ACL_XML3_NODE *node = acl_xml3_getElementById(xml, id); |
| 385 | |
| 386 | printf("--------------- acl_xml3_getElementById ---------------\r\n"); |
| 387 | if (node == NULL) { |
| 388 | printf(">>>id: %s not found\r\n", id); |
| 389 | return NULL; |
| 390 | } |
| 391 | |
| 392 | printf("tag-> %s, text: %s\n", node->ltag, node->text); |
| 393 | |
| 394 | /* ������ xml �������� */ |
| 395 | acl_foreach(iter1, node->attr_list) { |
| 396 | ACL_XML3_ATTR *attr = (ACL_XML3_ATTR*) iter1.data; |
| 397 | printf("\tattr_name: %s, attr_value: %s\n", |
| 398 | attr->name, attr->value); |
| 399 | } |
| 400 | |
| 401 | printf("----------- the id2_2's next node is ------------\n"); |
| 402 | |
| 403 | node = acl_xml3_node_next(node); |
| 404 | |
| 405 | if (node) { |
| 406 | printf("-------------- walk node ----------------\n"); |
| 407 | |
| 408 | /* ������ xml �������� */ |
| 409 | acl_foreach(iter1, node->attr_list) { |
| 410 | ACL_XML3_ATTR *attr = (ACL_XML3_ATTR*) iter1.data; |
| 411 | printf("\tattr_name: %s, attr_value: %s\n", |
| 412 | attr->name, attr->value); |
| 413 | } |
| 414 | |
| 415 | } else |
| 416 | printf("-------------- null node ----------------\n"); |
| 417 | |
| 418 | printf("Enter any key to continue ...\r\n"); |
| 419 | getchar(); |
| 420 | |
| 421 | return node; |
| 422 | } |
| 423 | |
| 424 | static ACL_XML3 *get_xml(char *data, const char* root, int multi_root) |
| 425 | { |
no test coverage detected
searching dependent graphs…