php_xml.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Copyright (c) The PHP Group |
  4. +----------------------------------------------------------------------+
  5. | This source file is subject to version 3.01 of the PHP license, |
  6. | that is bundled with this package in the file LICENSE, and is |
  7. | available through the world-wide-web at the following url: |
  8. | https://www.php.net/license/3_01.txt |
  9. | If you did not receive a copy of the PHP license and are unable to |
  10. | obtain it through the world-wide-web, please send a note to |
  11. | license@php.net so we can mail you a copy immediately. |
  12. +----------------------------------------------------------------------+
  13. | Authors: Brad Lafountain <rodif_bl@yahoo.com> |
  14. | Shane Caraveo <shane@caraveo.com> |
  15. | Dmitry Stogov <dmitry@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_SOAP_XML_H
  19. #define PHP_SOAP_XML_H
  20. #define get_attribute(node, name) get_attribute_ex(node, name, NULL)
  21. #define get_node(node, name) get_node_ex(node, name, NULL)
  22. #define get_node_recursive(node, name) get_node_recursive_ex(node, name, NULL)
  23. #define get_node_with_attribute(node, name, attr, val) get_node_with_attribute_ex(node, name, NULL, attr, val, NULL)
  24. #define get_node_with_attribute_recursive(node, name, attr, val) get_node_with_attribute_recursive_ex(node, name, NULL, attr, val, NULL)
  25. #define node_is_equal(node, name) node_is_equal_ex(node, name, NULL)
  26. #define attr_is_equal(node, name) attr_is_equal_ex(node, name, NULL)
  27. xmlDocPtr soap_xmlParseFile(const char *filename);
  28. xmlDocPtr soap_xmlParseMemory(const void *buf, size_t size);
  29. xmlNsPtr attr_find_ns(xmlAttrPtr node);
  30. xmlNsPtr node_find_ns(xmlNodePtr node);
  31. int attr_is_equal_ex(xmlAttrPtr node, char *name, char *ns);
  32. int node_is_equal_ex(xmlNodePtr node, char *name, char *ns);
  33. xmlAttrPtr get_attribute_ex(xmlAttrPtr node,char *name, char *ns);
  34. xmlNodePtr get_node_ex(xmlNodePtr node,char *name, char *ns);
  35. xmlNodePtr get_node_recursive_ex(xmlNodePtr node,char *name, char *ns);
  36. xmlNodePtr get_node_with_attribute_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
  37. xmlNodePtr get_node_with_attribute_recursive_ex(xmlNodePtr node, char *name, char *name_ns, char *attribute, char *value, char *attr_ns);
  38. int parse_namespace(const xmlChar *inval,char **value,char **namespace);
  39. #define FOREACHATTRNODE(n,c,i) FOREACHATTRNODEEX(n,c,NULL,i)
  40. #define FOREACHATTRNODEEX(n,c,ns,i) \
  41. do { \
  42. if (n == NULL) { \
  43. break; \
  44. } \
  45. if (c) { \
  46. i = get_attribute_ex(n,c,ns); \
  47. } else { \
  48. i = n; \
  49. } \
  50. if (i != NULL) { \
  51. n = i;
  52. #define FOREACHNODE(n,c,i) FOREACHNODEEX(n,c,NULL,i)
  53. #define FOREACHNODEEX(n,c,ns,i) \
  54. do { \
  55. if (n == NULL) { \
  56. break; \
  57. } \
  58. if (c) { \
  59. i = get_node_ex(n,c,NULL); \
  60. } else { \
  61. i = n; \
  62. } \
  63. if(i != NULL) { \
  64. n = i;
  65. #define ENDFOREACH(n) \
  66. } \
  67. } while ((n = n->next));
  68. #endif