From 55c25c7275d659488479845b1f358f026c596782 Mon Sep 17 00:00:00 2001 From: George Schlossnagle Date: Sun, 3 Apr 2005 15:39:56 +0000 Subject: Fix qualified names for attributes according to attributeFormDefault. Add SOAP Interop tests from Dmitry. --- ext/soap/php_encoding.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext/soap/php_encoding.c') 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); -- cgit v1.2.1