diff options
author | George Schlossnagle <gschlossnagle@php.net> | 2005-10-06 22:30:24 +0000 |
---|---|---|
committer | George Schlossnagle <gschlossnagle@php.net> | 2005-10-06 22:30:24 +0000 |
commit | abe0e61801ac9d98bd5280465c9b639cfeb6a5dd (patch) | |
tree | fd6db105d3def400e6d19f3f8d651b76f0d076a5 /ext/soap/php_encoding.c | |
parent | 35c82a75eb91c37977b6e1ee5122c2a8d56b55ec (diff) | |
download | php-git-abe0e61801ac9d98bd5280465c9b639cfeb6a5dd.tar.gz |
MFH: support complex types in restrictions and extensions
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r-- | ext/soap/php_encoding.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index ece66dfa90..90e614f7b7 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -319,6 +319,10 @@ xmlNodePtr master_to_xml(encodePtr encode, zval *data, int style, xmlNodePtr par node = encode->to_xml_after(&encode->details, node, style); } } + if(!node) { + node = xmlNewNode(NULL,"BOGUS"); + xmlAddChild(parent, node); + } return node; } @@ -1512,7 +1516,6 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo int i; sdlTypePtr sdlType = type->sdl_type; TSRMLS_FETCH(); - if (!data || Z_TYPE_P(data) == IS_NULL) { xmlParam = xmlNewNode(NULL,"BOGUS"); xmlAddChild(parent, xmlParam); @@ -1535,6 +1538,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo enc = sdlType->encode; while (enc && enc->details.sdl_type && + enc->details.sdl_type->kind != XSD_TYPEKIND_COMPLEX && enc->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE && enc->details.sdl_type->kind != XSD_TYPEKIND_LIST && enc->details.sdl_type->kind != XSD_TYPEKIND_UNION) { @@ -1544,12 +1548,9 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo zval *tmp = get_zval_property(data, "_" TSRMLS_CC); if (tmp) { xmlParam = master_to_xml(enc, tmp, style, parent); - } else if (prop == NULL) { - xmlParam = master_to_xml(enc, data, style, parent); } else { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); - } + xmlParam = master_to_xml(enc, data, style, parent); + } } else { xmlParam = xmlNewNode(NULL,"BOGUS"); xmlAddChild(parent, xmlParam); @@ -1557,6 +1558,7 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo } else if (sdlType->kind == XSD_TYPEKIND_EXTENSION && sdlType->encode && type != &sdlType->encode->details) { if (sdlType->encode->details.sdl_type && + sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_COMPLEX && sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_SIMPLE && sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST && sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) { @@ -1566,11 +1568,8 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo if (tmp) { xmlParam = master_to_xml(sdlType->encode, tmp, style, parent); - } else if (prop == NULL) { - xmlParam = master_to_xml(sdlType->encode, data, style, parent); } else { - xmlParam = xmlNewNode(NULL,"BOGUS"); - xmlAddChild(parent, xmlParam); + xmlParam = master_to_xml(sdlType->encode, data, style, parent); } } } else { |