diff options
author | Dmitry Stogov <dmitry@php.net> | 2004-02-17 18:54:30 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2004-02-17 18:54:30 +0000 |
commit | b17eab9a313b0fbd13c3a88ea1432e698e6ae74a (patch) | |
tree | 87a394a643fd8764b1dc93d4e48fdb30d246a7bf /ext/soap/php_encoding.c | |
parent | 7edf9bc2c346ecbc6b82610d30f29431085ce0b9 (diff) | |
download | php-git-b17eab9a313b0fbd13c3a88ea1432e698e6ae74a.tar.gz |
Using element namesapces with literal encoding.
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r-- | ext/soap/php_encoding.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 4a16e8ee06..b7859fdae5 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -992,6 +992,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, HashTa property = master_to_xml(enc, *val, style, node); } xmlNodeSetName(property, model->u.element->name); + if (style == SOAP_LITERAL && model->u.element->namens) { + xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens); + xmlSetNs(property, nsp); + } zend_hash_move_forward(ht); } } else { @@ -1008,6 +1012,10 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, HashTa property = master_to_xml(enc, *data, style, node); } xmlNodeSetName(property, model->u.element->name); + if (style == SOAP_LITERAL && model->u.element->namens) { + xmlNsPtr nsp = encode_add_ns(property, model->u.element->namens); + xmlSetNs(property, nsp); + } } return 1; } else if (model->min_occurs == 0) { @@ -1162,8 +1170,8 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo if (prop != NULL) { sdlTypePtr array_el; - if (Z_TYPE_P(data) == IS_ARRAY && - !is_map(data) && + if (Z_TYPE_P(data) == IS_ARRAY && + !is_map(data) && sdlType->attributes == NULL && sdlType->model != NULL && (array_el = model_array_element(sdlType->model)) != NULL) { @@ -1185,6 +1193,10 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo property = master_to_xml(array_el->encode, *val, style, xmlParam); } xmlNodeSetName(property, array_el->name); + if (style == SOAP_LITERAL && array_el->namens) { + xmlNsPtr nsp = encode_add_ns(property, array_el->namens); + xmlSetNs(property, nsp); + } zend_hash_move_forward(prop); } } else if (sdlType->model) { |