]> gerrit.simantics Code Review - simantics/interop.git/blobdiff - org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConversionBase.java
Switch to delayed write for more performance.
[simantics/interop.git] / org.simantics.xml.sax / src / org / simantics / xml / sax / SchemaConversionBase.java
index 863162c2ca873ad5d8180a69524fda1a22a73360..cb0f7629f2ca38f28f16a7d9cc11313f6dc6444c 100644 (file)
@@ -1359,6 +1359,7 @@ public final class SchemaConversionBase {
        
        public static class Inheritance {
                public String baseClass;
+               public String additionalClass;
                public InheritanceType type;
                public TypeEntry atomicType;
                
@@ -1392,12 +1393,15 @@ public final class SchemaConversionBase {
                                QName type = topLevelElement.getType();
                                if (!type.getNamespaceURI().equals(SCHEMA_NS)) {
                                        SchemaObject obj = complexTypeName.get(type.getLocalPart());
-       //                              if (obj == null)
-       //                                      obj = simpleTypeName.get(type.getLocalPart());
                                        if (obj != null) {
                                                inheritance.baseClass = getName(obj);
                                                inheritance.type = InheritanceType.ComplexType;
                                        }
+                                       else {
+                                               obj = simpleTypeName.get(type.getLocalPart());
+                                               if (obj != null)
+                                                       getAtomicTypeInheritance(type, inheritance);
+                                       }
                                } else {
                                        TypeEntry entry = getTypeEntry(type);
                                        if (entry != null) {
@@ -1454,6 +1458,9 @@ public final class SchemaConversionBase {
                                ExtensionType extensionType = simpleContent.getExtension();
                                if (extensionType != null) {
                                        type = extensionType.getBase();
+                                       SchemaObject simpleType = getSimpleType(type);
+                                       if (simpleType != null)
+                                               inheritance.additionalClass = getName(simpleType);
                                        getAtomicTypeInheritance(type, inheritance);
                                }
                        }