private String getBaseType(Document document, String typeName) { String currentType = typeName; QName baseType; do { baseType = getBaseTypeInternal(document, currentType); if (null == baseType) { LOG.severe(new Message("UNDEFINED_SIMPLE_TYPE_MSG", LOG, typeName).toString()); return null; } else if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(baseType.getNamespaceURI())) { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Base type for " + typeName + ": " + baseType); } return baseType.getLocalPart(); } else if (!namespaceURI.equals(baseType.getNamespaceURI())) { LOG.severe(new Message("SIMPLE_TYPE_DEFINED_IN_OTHER_NAMESPACE_MSG", LOG, typeName, namespaceURI).toString()); return null; } currentType = baseType.getLocalPart(); } while (true); }