summaryrefslogtreecommitdiff
path: root/ext/soap/php_schema.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2004-01-30 15:07:19 +0000
committerDmitry Stogov <dmitry@php.net>2004-01-30 15:07:19 +0000
commitb81645edd3912d6dca99d56649736a0b23056964 (patch)
tree3db256bb236511558a7a5e2b01d804bac1cf8c9f /ext/soap/php_schema.c
parent356e8f9b7d9495874244143e0ec490b519c1c3cf (diff)
downloadphp-git-b81645edd3912d6dca99d56649736a0b23056964.tar.gz
SOAP 1.2 specification conformity was improved
Diffstat (limited to 'ext/soap/php_schema.c')
-rw-r--r--ext/soap/php_schema.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c
index cd114ca33b..69372c39ce 100644
--- a/ext/soap/php_schema.c
+++ b/ext/soap/php_schema.c
@@ -115,48 +115,6 @@ static encodePtr get_create_encoder(sdlPtr sdl, sdlTypePtr cur_type, const char
return enc;
}
-static int is_blank(const char* str)
-{
- while (*str != '\0') {
- if (*str != ' ' && *str != 0x9 && *str != 0xa && *str != 0xd) {
- return 0;
- }
- str++;
- }
- return 1;
-}
-
-/* removes all empty text, comments and other insignoficant nodes */
-static void schema_cleanup(xmlNodePtr schema)
-{
- xmlNodePtr trav;
- xmlNodePtr del = NULL;
-
- trav = schema->children;
- while (trav != NULL) {
- if (del != NULL) {
- xmlUnlinkNode(del);
- xmlFreeNode(del);
- del = NULL;
- }
- if (trav->type == XML_TEXT_NODE) {
- if (is_blank(trav->content)) {
- del = trav;
- }
- } else if ((trav->type != XML_ELEMENT_NODE) &&
- (trav->type != XML_CDATA_SECTION_NODE)) {
- del = trav;
- } else if (trav->children != NULL) {
- schema_cleanup(trav);
- }
- trav = trav->next;
- }
- if (del != NULL) {
- xmlUnlinkNode(del);
- xmlFreeNode(del);
- }
-}
-
static void schema_load_file(sdlPtr sdl, xmlAttrPtr ns, xmlChar *location, xmlAttrPtr tns, int import) {
if (location != NULL &&
!zend_hash_exists(&sdl->docs, location, strlen(location)+1)) {
@@ -169,6 +127,7 @@ static void schema_load_file(sdlPtr sdl, xmlAttrPtr ns, xmlChar *location, xmlAt
if (doc == NULL) {
php_error(E_ERROR, "SOAP-ERROR: Parsing Schema: can't import schema from '%s'",location);
}
+ cleanup_xml(doc);
schema = get_node(doc->children, "schema");
if (schema == NULL) {
xmlFreeDoc(doc);
@@ -226,7 +185,6 @@ int load_schema(sdlPtr sdl,xmlNodePtr schema)
xmlNodePtr trav;
xmlAttrPtr tns;
- schema_cleanup(schema);
if (!sdl->types) {
sdl->types = malloc(sizeof(HashTable));
zend_hash_init(sdl->types, 0, NULL, delete_type, 1);