MCPcopy Create free account
hub / github.com/acl-dev/acl / walk_xml_node

Function walk_xml_node

lib_acl/samples/xml/xml6/xml.c:296–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296static void walk_xml_node(ACL_XML3_NODE *node, int n)
297{
298 ACL_ITER iter;
299
300 /* ���������ӽ�� */
301
302 acl_foreach(iter, node) {
303 int i;
304 ACL_XML3_NODE *child = (ACL_XML3_NODE*) iter.data;
305
306 for (i = 0; i < n; i++)
307 printf("\t");
308
309 printf("tag->%s, size: %ld, %ld\n", child->ltag,
310 (long) child->ltag_size, (long) strlen(child->ltag));
311
312 if (child->ltag_size != strlen(child->ltag)) {
313 printf("%s(%d): ltag_size invalid\r\n",
314 __FUNCTION__, __LINE__);
315 exit (1);
316 }
317
318 xml_node_attrs(child, n + 1);
319
320 for (i = 0; i < n + 1; i++)
321 printf("\t");
322
323 printf("text->%s, size: %ld, %ld\n", child->text,
324 (long) child->text_size, (long) strlen(child->text));
325
326 if (child->text_size != strlen(child->text)) {
327 printf("%s(%d): text_size invalid\r\n",
328 __FUNCTION__, __LINE__);
329 exit (1);
330 }
331
332 walk_xml_node(child, n + 1);
333 }
334}
335
336static void list_xml_tags(ACL_XML3 *xml)
337{

Callers 3

parse_xmlFunction · 0.70
test1Function · 0.70

Calls 2

xml_node_attrsFunction · 0.70
acl_foreachFunction · 0.50

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…