X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.xml.sax%2Fsrc%2Forg%2Fsimantics%2Fxml%2Fsax%2FSchemaConversionBase.java;fp=org.simantics.xml.sax%2Fsrc%2Forg%2Fsimantics%2Fxml%2Fsax%2FSchemaConversionBase.java;h=f523076ee7a8f00162238f20d905d306f68bbf6f;hb=bcfe73ff5f614ff83f20ce7bf5bfc0fa1b045978;hp=f35a8845acc74e7a0e081ffdf76498c67b7cf5b9;hpb=ada38ab0a1a98dcb413bef3273064da36ce2d273;p=simantics%2Finterop.git diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConversionBase.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConversionBase.java index f35a884..f523076 100644 --- a/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConversionBase.java +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/SchemaConversionBase.java @@ -436,6 +436,23 @@ public abstract class SchemaConversionBase { return null; } + protected QName getPrimitiveType(Attribute attribute) { + QName type = getBaseType(attribute); + String b = getBindingFromPrimitiveType(type); + while (b==null && type != null) { + SchemaObject baseType = simpleTypeName.get(type.getLocalPart()); + if (baseType != null) { + Restriction restriction = baseType.getSimpleType().getRestriction(); + if (restriction != null) + if (restriction.getBase() != null) { + type = restriction.getBase(); + b = getBindingFromPrimitiveType(type); + } + } + } + return type; + } + protected Attribute getRefAttribute(QName ref) { for (OpenAttrs attrs : schema.getSimpleTypeOrComplexTypeOrGroup()) { if (attrs instanceof TopLevelAttribute) {