summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/databinding-sdo
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-07-30 22:06:44 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-07-30 22:06:44 +0000
commite29862c8a179a0f815fe16506d1d71b17a0eca9a (patch)
tree26111f61f24b3cf479a1463763d9a38debdcdbc5 /java/sca/modules/databinding-sdo
parentf4fe8ce437b8ba7ba45882d3dda8facc7c9bef0f (diff)
Add the workaround to deal with annoymous XSD types
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@681219 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/databinding-sdo')
-rw-r--r--java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java b/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java
index 082ce48fbd..c1978883df 100644
--- a/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java
+++ b/java/sca/modules/databinding-sdo/src/main/java/org/apache/tuscany/sca/databinding/sdo/SDOTypeHelper.java
@@ -159,11 +159,24 @@ public class SDOTypeHelper implements XMLTypeHelper {
}
// make sure all the required types are defined in the resolved schema
for (Type type : entry.getValue()) {
- QName typeName = new QName(type.getURI(), type.getName());
- if (resolved.getXmlSchemaType(typeName) == null) {
- //FIXME: create a checked exception and propagate it back up to the activator
- throw new RuntimeException("No XSD found for " + typeName.toString());
+ String name = xsdHelper.getLocalName(type);
+ QName typeName = null;
+ if (name.endsWith("_._type")) {
+ // FIXME: Anonymous tyype
+ name = name.substring(0, name.length() - "_._type".length());
+ typeName = new QName(type.getURI(), name);
+ if (resolved.getXmlSchemaElement(typeName) == null) {
+ //FIXME: create a checked exception and propagate it back up to the activator
+ throw new RuntimeException("No XSD found for " + typeName.toString());
+ }
+ } else {
+ typeName = new QName(type.getURI(), name);
+ if (resolved.getXmlSchemaType(typeName) == null) {
+ //FIXME: create a checked exception and propagate it back up to the activator
+ throw new RuntimeException("No XSD found for " + typeName.toString());
+ }
}
+
}
definitions.add(resolved);
}