| 309 | } |
| 310 | |
| 311 | static void walk_xml_node(ACL_XML2_NODE *node, int n) |
| 312 | { |
| 313 | ACL_ITER iter; |
| 314 | |
| 315 | /* ���������ӽ�� */ |
| 316 | |
| 317 | acl_foreach(iter, node) { |
| 318 | int i; |
| 319 | ACL_XML2_NODE *child = (ACL_XML2_NODE*) iter.data; |
| 320 | |
| 321 | for (i = 0; i < n; i++) |
| 322 | printf("\t"); |
| 323 | |
| 324 | printf("%s(%d): tag->%s, size: %ld, %ld\n", __FUNCTION__, |
| 325 | __LINE__, child->ltag, (long) child->ltag_size, |
| 326 | (long) strlen(child->ltag)); |
| 327 | |
| 328 | if ((size_t) child->ltag_size != strlen(child->ltag)) { |
| 329 | printf("%s(%d): ltag_size invalid, ltag: %s, " |
| 330 | "len: %ld, %ld\r\n", __FUNCTION__, __LINE__, |
| 331 | child->ltag, (long) child->ltag_size, |
| 332 | (long) strlen(child->ltag)); |
| 333 | assert(0); |
| 334 | } |
| 335 | |
| 336 | xml_node_attrs(child, n + 1); |
| 337 | |
| 338 | for (i = 0; i < n + 1; i++) |
| 339 | printf("\t"); |
| 340 | |
| 341 | printf("%s(%d): text->%s, size: %ld, %ld\n", __FUNCTION__, |
| 342 | __LINE__, child->text, (long) child->text_size, |
| 343 | (long) strlen(child->text)); |
| 344 | if ((size_t) child->text_size != strlen(child->text)) { |
| 345 | printf("%s(%d): text_size invalid: %ld, %ld, " |
| 346 | "text: %s\r\n", __FUNCTION__, __LINE__, |
| 347 | (long) child->text_size, |
| 348 | (long) strlen(child->text), child->text); |
| 349 | assert(0); |
| 350 | } |
| 351 | |
| 352 | walk_xml_node(child, n + 1); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | static void list_xml_tags(ACL_XML2 *xml) |
| 357 | { |
searching dependent graphs…