Author: amilas Date: Sat Jun 12 08:25:46 2010 New Revision: 953953 URL: http://svn.apache.org/viewvc?rev=953953&view=rev Log: added support to chemeleon pattern
Modified: axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/testsuite/chameleon_include.xsd Modified: axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?rev=953953&r1=953952&r2=953953&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original) +++ axis/axis2/java/core/trunk/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Sat Jun 12 08:25:46 2010 @@ -371,7 +371,17 @@ public class SchemaCompiler { } if (o instanceof XmlSchemaInclude) { XmlSchema schema1 = ((XmlSchemaInclude) o).getSchema(); - if (schema1 != null) compile(schema1, isPartofGroup); + if (schema1 != null){ + if (schema1.getTargetNamespace() == null){ + // the target namespace of an included shchema should be same + // as the parent schema however if the schema uses the chemalon pattern + // target namespace can be null. so set it here. + // http://www.xfront.com/ZeroOneOrManyNamespaces.html#mixed + schema1.setTargetNamespace(schema.getTargetNamespace()); + } + compile(schema1, isPartofGroup); + } + } } } Modified: axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/testsuite/chameleon_include.xsd URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/testsuite/chameleon_include.xsd?rev=953953&r1=953952&r2=953953&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/testsuite/chameleon_include.xsd (original) +++ axis/axis2/java/core/trunk/modules/adb-codegen/test-resources/testsuite/chameleon_include.xsd Sat Jun 12 08:25:46 2010 @@ -18,7 +18,6 @@ ~ under the License. --> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" - targetNamespace="http://apache.org/axis2/schema/chameleon" elementFormDefault="qualified"> <xsd:complexType name="SupportingSchemaType"> <xsd:sequence>