]> gerrit.simantics Code Review - simantics/interop.git/blobdiff - org.simantics.xml.sax/src/org/simantics/xml/sax/ImporterGenerator.java
Handling untyped attribute definitions by using String
[simantics/interop.git] / org.simantics.xml.sax / src / org / simantics / xml / sax / ImporterGenerator.java
index cff87ed72fcfc43ef3b65ac1d5090eadf687c287..c312ab829d96afc952f6b5728cd5bc2494a2a510 100644 (file)
@@ -525,7 +525,10 @@ public class ImporterGenerator extends SchemaConversionBase{
                        String binding = getBindingFromPrimitiveType(base);\r
                        writeAttribute(fw, attrName, relationName, binding, isReference);\r
                } else {\r
-                       throw new RuntimeException("Cannot resolve type for Attribute " + attrName + " -> " + primitiveType.getLocalPart());\r
+                       // TODO : using default String attribute should be configured with rules.\r
+                       //throw new RuntimeException("Cannot resolve type for Attribute " + attrName + " -> " + primitiveType.getLocalPart());\r
+                       fw.writer.println("    //FIXME: Cannot resolve type for Attribute " + attrName + " Using default type String");\r
+                       writeAttribute(fw, attrName, relationName, "STRING", isReference);\r
                }\r
        }\r
        \r
@@ -607,7 +610,8 @@ public class ImporterGenerator extends SchemaConversionBase{
                // FIXME : handle optional attributes properly.\r
                for (org.simantics.xml.sax.configuration.Attribute a : composition.getAttribute()) {\r
                        Attribute attribute = ((Attribute)attributes.getRight(a));\r
-                       QName atype = getBaseType(attribute);\r
+                       //QName atype = getBaseType(attribute);\r
+                       QName atype = getPrimitiveType(attribute);\r
                        String defaultValue = attribute.getDefault();\r
                        if (defaultValue == null)\r
                            defaultValue = getDefaultValue(atype);\r