summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.3/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
diff options
context:
space:
mode:
authornash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-06-22 20:26:27 +0000
committernash <nash@13f79535-47bb-0310-9956-ffa450edef68>2008-06-22 20:26:27 +0000
commit418233223529e72a1027cb4a714cae854fdd3787 (patch)
tree80f970ded4affd1e3bd4a94deed12e4f913cc18e /branches/sca-java-1.3/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
parent517609638e03d901d797c993bf8cacbf99d5b37a (diff)
Fix TUSCANY-2418
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@670410 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--branches/sca-java-1.3/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/branches/sca-java-1.3/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java b/branches/sca-java-1.3/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
index 42b34c7acc..652d9e8d83 100644
--- a/branches/sca-java-1.3/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
+++ b/branches/sca-java-1.3/modules/xsd-xml/src/main/java/org/apache/tuscany/sca/xsd/xml/XSDModelResolver.java
@@ -87,11 +87,13 @@ public class XSDModelResolver implements ModelResolver {
// Lookup a definition for the given namespace
String namespace = definition.getNamespace();
List<XSDefinition> list = map.get(namespace);
+ XSDefinition modelXSD = null;
if (list != null && definition.getDocument() != null) {
// Set the document for the inline schema
int index = list.indexOf(definition);
- if (index != -1) {
- list.get(index).setDocument(definition.getDocument());
+ if (index != -1) { // a matching (not identical) document was found
+ modelXSD = list.get(index);
+ modelXSD.setDocument(definition.getDocument());
}
}
if (list == null && definition.getDocument() != null) {
@@ -107,6 +109,14 @@ public class XSDModelResolver implements ModelResolver {
throw new ContributionRuntimeException(e);
}
if (resolved != null && !resolved.isUnresolved()) {
+ if (definition.isUnresolved() && definition.getSchema() == null && modelXSD != null) {
+ // Update the unresolved model with schema information and mark it
+ // resolved. This information in the unresolved model is needed when
+ // this method is called by WSDLModelResolver.readInlineSchemas().
+ definition.setSchema(modelXSD.getSchema());
+ definition.setSchemaCollection(modelXSD.getSchemaCollection());
+ definition.setUnresolved(false);
+ }
return modelClass.cast(resolved);
}
@@ -221,7 +231,7 @@ public class XSDModelResolver implements ModelResolver {
java.lang.String schemaLocation,
java.lang.String baseUri) {
try {
- if (schemaLocation == null || schemaLocation.startsWith("/")) {
+ if (schemaLocation == null) {
return null;
}
URL url = null;