facet.getValue());
String facetName = schemaPrefix + facet.getName();
_handler.startElement(facetName, _atts);
Enumeration annotations = facet.getAnnotations();
while (annotations.hasMoreElements()) {
Annotation annotation = (Annotation)annotations.nextElement();
processAnnotation(annotation, schemaPrefix);
}
_handler.endElement(facetName);
}
_handler.endElement(ELEM_RESTRICTION);
}
else if (simpleType instanceof Union) {
processUnion((Union)simpleType, schemaPrefix);
}
//-- handle List
else {
String ELEM_LIST = schemaPrefix + SchemaNames.LIST;
_atts.clear();
SimpleType itemType = ((ListType)simpleType).getItemType();
boolean topLevel = (itemType.getParent() == itemType.getSchema());
if (itemType.isBuiltInType() || topLevel) {
typeName = itemType.getName();
//-- add "xsd" prefix if necessary
if ((typeName.indexOf(':') < 0) && itemType.isBuiltInType()) {
typeName = schemaPrefix + typeName;
}
_atts.addAttribute("itemType", CDATA, typeName);
}
_handler.startElement(ELEM_LIST, _atts);
//-- processAnnotations
Annotation ann = ((ListType)simpleType).getLocalAnnotation();
if (ann != null) {
processAnnotation(ann, schemaPrefix);
}
//-- process simpleType if necessary
if ((! topLevel) && (! itemType.isBuiltInType())) {