int typeFinality = parseSimpleTypeDerivationSet(typeFinal);
QName typeName = asQName(getAttribute(attrs, "name"), simpleType);
int variety = 0;
Set facets = new LinkedHashSet();
int fundamentalFacets = 0; // TODO
SimpleType baseType = null; // TODO
Annotation annotation = null;
// TODO use DatatypeBuilder
for (Node child = simpleType.getFirstChild(); child != null;
child = child.getNextSibling())
{
String uri = child.getNamespaceURI();
String name = child.getLocalName();
if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(uri) &&
child.getNodeType() == Node.ELEMENT_NODE)
{
if ("annotation".equals(name))
{
annotation = parseAnnotation(child);
}
else if ("restriction".equals(name))
{
// TODO
}
else if ("list".equals(name))
{
variety = SimpleType.LIST;
// TODO
}
else if ("union".equals(name))
{
variety = SimpleType.UNION;
// TODO
}
}
}
return new SimpleType(typeName, variety, facets, fundamentalFacets,
baseType, annotation);
}