handle schema import with namespace attribute when schemaLocation is not set
----------------------------------------------------------------------------

                 Key: WSCOMMONS-63
                 URL: http://issues.apache.org/jira/browse/WSCOMMONS-63
             Project: WS-Commons
          Issue Type: Improvement
          Components: XmlSchema
            Reporter: Arnaud MERGEY


XmlSchema should try to import schema with namespace attribute  for example 
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

I propose this patch:

Index: org/apache/ws/commons/schema/SchemaBuilder.java
===================================================================

retrieving revision 1.1
diff -u -r1.1 SchemaBuilder.java
--- org/apache/ws/commons/schema/SchemaBuilder.java     26 Jun 2006 15:10:16 
-0000      1.1
+++ org/apache/ws/commons/schema/SchemaBuilder.java     21 Jul 2006 14:10:21 
-0000
@@ -1721,6 +1721,31 @@
                                 schemaImport.schemaLocation);
             }
         }
+        else //XXX AM modification in order to support schema import
+        {
+         try
+         {
+                 if(schema.getSourceURI()!=null) {
+                     schemaImport.schema =
+                             resolveXmlSchema(
+                                     schemaImport.namespace,
+                                     schemaImport.namespace,
+                                     schema.getSourceURI());
+                 } else {
+                     schemaImport.schema =
+                             resolveXmlSchema(
+                                     schemaImport.namespace,
+                                     schemaImport.namespace);
+                 }
+         }
+         catch (RuntimeException e)
+         {
+                 if(!(e.getCause() instanceof XmlSchemaException))
+                 {
+                         throw e;
+                 }
+         }
+        }
         return schemaImport;
     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to