+ QName base = this.base.getSimpleTypeBase(simpleType);\r
+ Inheritance inheritance = new Inheritance("");\r
+ this.base.getAtomicTypeInheritance(base, inheritance);\r
+ if (inheritance.atomicType == null)\r
+ throw new RuntimeException("Could not locate atomic type for SimpleType " + simpleType.getName());\r
+ writer.println(" --> " + inheritance.atomicType.l0Type);\r
+ \r
+// Restriction restriction = simpleType.getRestriction();\r
+// if (restriction != null) {\r
+// \r
+// QName base = restriction.getBase();\r
+// String ontType = getL0Type(base);\r
+// writer.println(" --> " + ontType);\r
+// } else if (simpleType.getId() != null) {\r
+// throw new RuntimeException(simpleType.getName() + " restriction error");\r
+// } else if (simpleType.getUnion() != null) {\r
+// Union union = simpleType.getUnion();\r
+// String ontType = null;\r
+// if (union.getMemberTypes().size() > 0) {\r
+// for (QName type : union.getMemberTypes()) {\r
+// String sType = null;\r
+// TypeEntry entry = getTypeEntry(type);\r
+// if (entry == null) {\r
+// SchemaObject obj = simpleTypeName.get(type.getLocalPart());\r
+// Inheritance inheritance = new Inheritance("");\r
+// getAtomicTypeInheritance(type, obj, inheritance);\r
+// sType = inheritance.atomicType.l0Type;\r
+// } else {\r
+// sType = entry.l0Type;\r
+// }\r
+// if (ontType == null)\r
+// ontType = sType;\r
+// else if (!ontType.equals(sType))\r
+// throw new RuntimeException(simpleType.getName() + " union has incompatible member types");\r
+// }\r
+// } else {\r
+// if (union.getSimpleType().size() == 0)\r
+// throw new RuntimeException(simpleType.getName() + " union error");\r
+// for (SimpleType s : union.getSimpleType()) {\r
+// if (restriction == null)\r
+// restriction = s.getRestriction();\r
+// else {\r
+// Restriction r = s.getRestriction();\r
+// if (!r.getBase().equals(restriction.getBase()))\r
+// throw new RuntimeException(simpleType.getName() + " union has incompatible restriction bases");\r
+// }\r
+// }\r
+// QName base = restriction.getBase();\r
+// ontType = getL0Type(base);\r
+// }\r
+// writer.println(" --> " + ontType);\r
+// } else {\r
+// throw new RuntimeException(simpleType.getName() + " restriction error");\r
+// }\r
+ \r