Test 49 looks totally incorrect to me. You've derived the object by restriction in accordance with section 2.5.2.1 of the Schema Part 2 spec,

[Definition:] A datatype is said to be ·derived· by restriction from another datatype when values for zero or more ·constraining facet·s are specified that serve to constrain its ·value space· and/or its lexical space to a subset of the base type.

Check http://www.w3.org/TR/xmlschema-2/#derivation-by-restriction and http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details for more details.

but you aren't constraining the type to be a subset of the base type, in fact you ignore the base type completely and just implement your own parameter there, which seems to violate the way restrictions work.

Test 49 _should_ look like this:




Further, if you specify no constraints on a restriction, then you extend off that restriction. I've added test 81 which validates this (and fails with your reversion of my patch).

Here's a patch that makes 81 pass correctly and leaves 47 working. As I've stated, 49 just looks wrong:


George




On Oct 7, 2005, at 5:03 AM, Dmitry Stogov wrote:

Hi George,

Seems you patch is wrong.
It breaks ext/soap/tests/schema/shema047.phpt and
ext/soap/tests/schema/049.phpt.

I reverted the path.

Please provide test case, what is not working for you?

Thanks. Dmitry.


-----Original Message-----
From: George Schlossnagle [mailto:[EMAIL PROTECTED]
Sent: Friday, October 07, 2005 2:30 AM
To: php-cvs@lists.php.net
Subject: [PHP-CVS] cvs: php-src /ext/soap php_encoding.c


gschlossnagle        Thu Oct  6 18:30:11 2005 EDT

  Modified files:
    /php-src/ext/soap    php_encoding.c
  Log:
  support complex types in restrictions and extensions

http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1
=1.107&r2=1.108&ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.107
php-src/ext/soap/php_encoding.c:1.108
--- php-src/ext/soap/php_encoding.c:1.107    Thu Sep 29 06:00:59 2005
+++ php-src/ext/soap/php_encoding.c    Thu Oct  6 18:30:08 2005
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>
            |

+-------------------------------------------------------------
---------+
 */
-/* $Id: php_encoding.c,v 1.107 2005/09/29 10:00:59 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.108 2005/10/06 22:30:08
gschlossnagle Exp $
+*/

 #include <time.h>

@@ -319,6 +319,10 @@
             node =
encode->to_xml_after(&encode->details, node, style);
         }
     }
+    if(!node) {
+        node = xmlNewNode(NULL,"BOGUS");
+        xmlAddChild(parent, node);
+    }
     return node;
 }

@@ -1536,6 +1540,7 @@

             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) { @@ -1545,11 +1550,8 @@
                 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");
@@ -1558,6 +1560,7 @@
         } 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) { @@ -1567,12 +1570,9 @@

                 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 {
             xmlParam = xmlNewNode(NULL,"BOGUS");

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php







George Schlossnagle

-- Vice President of Engineering
-- OmniTI Computer Consulting
-- http://www.omniti.com


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to