private TypesElement parseTypes(
XMLElement typesEl,
DescriptionElement desc)
throws WSDLException {
TypesElement types = desc.addTypesElement();
//TODO for now set to W3 XML Schema. Later, add support for non-XML Schema type systems
types.setTypeSystem(Constants.TYPE_XSD_2001);
parseExtensionAttributes(typesEl, TypesElement.class, types, desc);
XMLElement[] children = typesEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
for(int i=0; i<children.length; i++)
{
tempEl = children[i];
tempElQN = tempEl.getQName();
//TODO validate element order? <documentation> must be first.
if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
{
parseDocumentation(tempEl, desc, types);
}
else if (SchemaConstants.Q_ELEM_SCHEMA_IMPORT.equals(tempElQN))
{
types.addSchema(parseSchemaImport(tempEl, desc));
}
else if (SchemaConstants.Q_ELEM_SCHEMA.equals(tempElQN))
{
types.addSchema(parseSchemaInline(tempEl, desc));
}
else
{
types.addExtensionElement(
parseExtensionElement(TypesElement.class, types, tempEl, desc) );
}
}
return types;