1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef PHP_SOAP_XML_H
23 #define PHP_SOAP_XML_H
24
25 #define get_attribute(node, name) get_attribute_ex(node, name, NULL)
26 #define get_node(node, name) get_node_ex(node, name, NULL)
27 #define get_node_recursive(node, name) get_node_recursive_ex(node, name, NULL)
28 #define get_node_with_attribute(node, name, attr, val) get_node_with_attribute_ex(node, name, NULL, attr, val, NULL)
29 #define get_node_with_attribute_recursive(node, name, attr, val) get_node_with_attribute_recursive_ex(node, name, NULL, attr, val, NULL)
30 #define node_is_equal(node, name) node_is_equal_ex(node, name, NULL)
31 #define attr_is_equal(node, name) attr_is_equal_ex(node, name, NULL)
32
33 xmlDocPtr soap_xmlParseFile(const char *filename);
34 xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size);
35
36 xmlNsPtr attr_find_ns(xmlAttrPtr node);
37 xmlNsPtr node_find_ns(xmlNodePtr node);
38 int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns);
39 int node_is_equal_ex(xmlNodePtr node, char *name, char *ns);
40 xmlAttrPtr get_attribute_ex(xmlAttrPtr node,char *name, char *ns);
41 xmlNodePtr get_node_ex(xmlNodePtr node,char *name, char *ns);
42 xmlNodePtr get_node_recursive_ex(xmlNodePtr node,char *name, char *ns);
43 xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
44 xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
45 int parse_namespace(const xmlChar *inval,char **value,char **namespace);
46
47 #define FOREACHATTRNODE(n,c,i) FOREACHATTRNODEEX(n,c,NULL,i)
48 #define FOREACHATTRNODEEX(n,c,ns,i) \
49 do { \
50 if (n == NULL) { \
51 break; \
52 } \
53 if (c) { \
54 i = get_attribute_ex(n,c,ns); \
55 } else { \
56 i = n; \
57 } \
58 if (i != NULL) { \
59 n = i;
60
61 #define FOREACHNODE(n,c,i) FOREACHNODEEX(n,c,NULL,i)
62 #define FOREACHNODEEX(n,c,ns,i) \
63 do { \
64 if (n == NULL) { \
65 break; \
66 } \
67 if (c) { \
68 i = get_node_ex(n,c,NULL); \
69 } else { \
70 i = n; \
71 } \
72 if(i != NULL) { \
73 n = i;
74
75 #define ENDFOREACH(n) \
76 } \
77 } while ((n = n->next));
78
79 #endif