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

Function walk_xml

lib_acl/samples/xml/xml6/xml.c:223–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223static void walk_xml(ACL_XML3* xml)
224{
225 ACL_ITER iter1;
226
227 /* �Ӹ���㿪ʼ���� xml ��������н�� */
228
229 printf("-------------- walk_xml -----------------------\r\n");
230
231 acl_foreach(iter1, xml) {
232 int i;
233 ACL_ITER iter2;
234 ACL_XML3_NODE *node = (ACL_XML3_NODE*) iter1.data;
235
236 for (i = 1; i < node->depth; i++)
237 printf("\t");
238
239 printf("tag->%s, size: %ld\n", node->ltag,
240 (long) node->ltag_size);
241 if (node->ltag_size != strlen(node->ltag)) {
242 printf("ltag_size invalid\r\n");
243 exit (1);
244 }
245
246 /* ���� xml �������� */
247 acl_foreach(iter2, node->attr_list) {
248 ACL_XML3_ATTR *attr = (ACL_XML3_ATTR*) iter2.data;
249
250 for (i = 1; i < node->depth + 1; i++)
251 printf("\t");
252
253 printf("attr->%s=\"%s\"\n", attr->name, attr->value);
254 }
255
256 for (i = 1; i < node->depth + 1; i++)
257 printf("\t");
258 printf("text->%s, size: %ld\n", node->text,
259 (long) node->text_size);
260 }
261
262 printf("-------------- walk_xml end -------------------\r\n");
263
264 printf("Enter any key to continue ...\r\n");
265 getchar();
266}
267
268static void xml_node_attrs(ACL_XML3_NODE* node, int n)
269{

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…