php_xml.h 3.3 KB

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