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

Function walk_xml

lib_acl/samples/xml/xml2/main.c:136–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134#define STR acl_vstring_str
135
136static void walk_xml(ACL_XML* xml)
137{
138 ACL_ITER iter1;
139
140 /* �Ӹ���㿪ʼ���� xml ��������н�� */
141
142 printf("-------------- walk_xml -----------------------\r\n");
143
144 acl_foreach(iter1, xml) {
145 int i;
146 ACL_ITER iter2;
147 ACL_XML_NODE *node = (ACL_XML_NODE*) iter1.data;
148
149 for (i = 1; i < node->depth; i++)
150 printf("\t");
151
152 printf("tag->%s, size: %ld\n", STR(node->ltag),
153 (long) LEN(node->ltag));
154
155 /* ���� xml �������� */
156 acl_foreach(iter2, node->attr_list) {
157 ACL_XML_ATTR *attr = (ACL_XML_ATTR*) iter2.data;
158
159 for (i = 1; i < node->depth + 1; i++)
160 printf("\t");
161
162 printf("attr->%s=\"%s\"\n", STR(attr->name),
163 STR(attr->value));
164 }
165
166 for (i = 1; i < node->depth + 1; i++)
167 printf("\t");
168 printf("text->%s, size: %ld\n", STR(node->text),
169 (long) LEN(node->text));
170 }
171
172 printf("-------------- walk_xml end -------------------\r\n");
173
174 printf("Enter any key to continue ...\r\n");
175 getchar();
176}
177
178static void xml_node_attrs(ACL_XML_NODE* node, int n)
179{

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…