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

Function walk_xml

lib_acl/samples/xml/xml3/xml.c:235–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235static void walk_xml(ACL_XML2* xml)
236{
237 ACL_ITER iter1;
238
239 /* �Ӹ���㿪ʼ���� xml ��������н�� */
240
241 printf("-------------- walk_xml -----------------------\r\n");
242
243 acl_foreach(iter1, xml) {
244 int i;
245 ACL_ITER iter2;
246 ACL_XML2_NODE *node = (ACL_XML2_NODE*) iter1.data;
247
248 for (i = 1; i < node->depth; i++)
249 printf("\t");
250
251 printf("%s(%d): tag->%s, size: %ld\n", __FUNCTION__, __LINE__,
252 node->ltag, (long) node->ltag_size);
253
254 /* ���� xml �������� */
255 acl_foreach(iter2, node->attr_list) {
256 ACL_XML2_ATTR *attr = (ACL_XML2_ATTR*) iter2.data;
257
258 for (i = 1; i < node->depth + 1; i++)
259 printf("\t");
260
261 printf("%s(%d): attr->%s=\"%s\"\n", __FUNCTION__,
262 __LINE__, attr->name, attr->value);
263 }
264
265 for (i = 1; i < node->depth + 1; i++)
266 printf("\t");
267 printf("%s(%d): text->%s, size: %ld\n", __FUNCTION__,
268 __LINE__, node->text, (long) node->text_size);
269 }
270
271 printf("-------------- walk_xml end -------------------\r\n");
272
273 printf("Enter any key to continue ...\r\n");
274 getchar();
275}
276
277static void xml_node_attrs(ACL_XML2_NODE* node, int n)
278{

Callers 1

parse_xmlFunction · 0.70

Calls 1

acl_foreachFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…