| 400 | } |
| 401 | |
| 402 | static ACL_XML2_NODE *test_getElementById(ACL_XML2 *xml, const char *id) |
| 403 | { |
| 404 | ACL_ITER iter1; |
| 405 | ACL_XML2_NODE *node = acl_xml2_getElementById(xml, id); |
| 406 | |
| 407 | printf("--------------- acl_xml2_getElementById ---------------\r\n"); |
| 408 | if (node == NULL) { |
| 409 | printf(">>>id: %s not found\r\n", id); |
| 410 | return NULL; |
| 411 | } |
| 412 | |
| 413 | printf("tag-> %s, text: %s\n", node->ltag, node->text); |
| 414 | |
| 415 | /* ������ xml �������� */ |
| 416 | acl_foreach(iter1, node->attr_list) { |
| 417 | ACL_XML2_ATTR *attr = (ACL_XML2_ATTR*) iter1.data; |
| 418 | printf("\tattr_name: %s, attr_value: %s\n", |
| 419 | attr->name, attr->value); |
| 420 | } |
| 421 | |
| 422 | printf("----------- the id2_2's next node is ------------\n"); |
| 423 | |
| 424 | node = acl_xml2_node_next(node); |
| 425 | |
| 426 | if (node) { |
| 427 | printf("-------------- walk node ----------------\n"); |
| 428 | |
| 429 | /* ������ xml �������� */ |
| 430 | acl_foreach(iter1, node->attr_list) { |
| 431 | ACL_XML2_ATTR *attr = (ACL_XML2_ATTR*) iter1.data; |
| 432 | printf("\tattr_name: %s, attr_value: %s\n", |
| 433 | attr->name, attr->value); |
| 434 | } |
| 435 | |
| 436 | } else |
| 437 | printf("-------------- null node ----------------\n"); |
| 438 | |
| 439 | printf("Enter any key to continue ...\r\n"); |
| 440 | getchar(); |
| 441 | |
| 442 | return node; |
| 443 | } |
| 444 | |
| 445 | static ACL_XML2 *get_xml(int once, const char *data, |
| 446 | const char* root, int multi_root) |
no test coverage detected
searching dependent graphs…