]> gerrit.simantics Code Review - simantics/interop.git/blobdiff - org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConversionBase.java
Schema conversion updates (necessary for Proteus PID Profile schema)
[simantics/interop.git] / org.simantics.xml.sax / src / org / simantics / xml / sax / SchemaConversionBase.java
index f35a8845acc74e7a0e081ffdf76498c67b7cf5b9..f523076ee7a8f00162238f20d905d306f68bbf6f 100644 (file)
@@ -436,6 +436,23 @@ public abstract class SchemaConversionBase {
                return null;\r
        }\r
        \r
+       protected QName getPrimitiveType(Attribute attribute) {\r
+               QName type = getBaseType(attribute);\r
+               String b = getBindingFromPrimitiveType(type);\r
+               while (b==null && type != null) {\r
+                       SchemaObject baseType = simpleTypeName.get(type.getLocalPart());\r
+                       if (baseType != null) {\r
+                               Restriction restriction = baseType.getSimpleType().getRestriction();\r
+                               if (restriction != null)\r
+                                       if (restriction.getBase() != null) {\r
+                                               type = restriction.getBase();\r
+                                               b = getBindingFromPrimitiveType(type);\r
+                                       }\r
+                       }\r
+               }\r
+               return type;\r
+       }\r
+       \r
        protected Attribute getRefAttribute(QName ref) {\r
                for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) {\r
                        if (attrs instanceof TopLevelAttribute) {\r