XSTypeDefinition tDef = eDec.getTypeDefinition();
// If this element declaration is of simple type
// then it is converted into a property def
if (tDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
XSSimpleTypeDefinition stDef = (XSSimpleTypeDefinition) tDef;
PropDef propDef = simpleTypeToPropDef(stDef, name, mandatory, multiple);
propDefList.add(propDef);
// If this element declaration is of complex type then
// it is converted into either node or property def
} else if (tDef.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
XSComplexTypeDefinition ctDef = (XSComplexTypeDefinition) tDef;
// If the complex type definition contains a simple content model
// and does not contain any attribute uses or attribute wildcards
// then the enclosing element is converted to a property def
if (ctDef.getContentType() == XSComplexTypeDefinition.CONTENTTYPE_SIMPLE && ctDef.getAttributeUses().getLength() == 0 && ctDef.getAttributeWildcard() == null) {
XSSimpleTypeDefinition std = ctDef.getSimpleType();
PropDef pd = simpleTypeToPropDef(std, name, mandatory, multiple);
propDefList.add(pd);
// If the complex type definition contains a complex content model
// or a simple content model with attribute uses or an attribute wildcard