summaryrefslogtreecommitdiff
path: root/ext/soap/php_encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/soap/php_encoding.c')
-rw-r--r--ext/soap/php_encoding.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index e9efb553cd..8e731679f4 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1479,11 +1479,11 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
if ((*attr)->fixed && strcmp((*attr)->fixed,dummy->children->content) != 0) {
soap_error3(E_ERROR, "Encoding: Attribute '%s' has fixed value '%s' (value '%s' is not allowed)", (*attr)->name, (*attr)->fixed, dummy->children->content);
}
- if ((*attr)->namens) {
-/*
- if ((*attr)->namens &&
- (type->ns == NULL || strcmp((*attr)->namens, type->ns))) {
-*/
+ /* we need to handle xml: namespace specially, since it is
+ an implicit schema. Otherwise, use form.
+ */
+ if (!strncmp((*attr)->namens, XML_NAMESPACE, sizeof(XML_NAMESPACE)) ||
+ (*attr)->form == XSD_FORM_QUALIFIED && (*attr)->namens) {
xmlNsPtr nsp = encode_add_ns(xmlParam, (*attr)->namens);
xmlSetNsProp(xmlParam, nsp, (*attr)->name, dummy->children->content);