[TYPE.NAME] is the name of the XSD built in SimpleType corresponding to
property.type, where the prefix is for the xsd namespace. Otherwise,
[TYPE.NAME] is property.type.name where the tns: prefix is determined by the
namespace declaration for the Type's URI.
*/
Type schemaSDOType = null;
QName schemaType = ((SDOProperty)property).getXsdType();
if (schemaType != null) {
schemaSDOType = ((SDOTypeHelper)aHelperContext.getTypeHelper()).getType(schemaType.getNamespaceURI(), schemaType.getLocalPart());
if ((property.getType() == SDOConstants.SDO_STRING) && (schemaSDOType != SDOConstants.SDO_STRING)) {
String sdoXmlPrefix = getPrefixForURI(SDOConstants.SDOXML_URL);
QName qname = new QName(SDOConstants.SDOXML_URL, SDOConstants.SDOXML_STRING_NAME, sdoXmlPrefix);
elem.getAttributesMap().put(qname, "true");
}
}
if (!property.isContainment() && !property.getType().isDataType()) {
schemaType = SDOConstants.ANY_URI_QNAME;
}
Type propertyType = property.getType();
if (propertyType != null) {
if (property.getContainingType() != null) {
addTypeToListIfNeeded(property.getContainingType(), propertyType);
}
if (schemaType == null) {
schemaType = ((SDOTypeHelper)aHelperContext.getTypeHelper()).getXSDTypeFromSDOType(propertyType);
}
//get url for prefix in namespace resolver and map sure it is added to the schema if necessary
if (schemaType != null) {
elem.setType(getPrefixStringForURI(schemaType.getNamespaceURI()) + schemaType.getLocalPart());
if (schemaSDOType != null) {
addTypeToListIfNeeded(property.getContainingType(), schemaSDOType);
}
} else if ((propertyType.getURI() == null) || (propertyType.getURI().equalsIgnoreCase(generatedSchema.getTargetNamespace()))) {
String xsdTypeLocalName = ((SDOType)propertyType).getXsdLocalName();
if (xsdTypeLocalName != null) {
elem.setType(xsdTypeLocalName);
} else {
elem.setType(propertyType.getName());
}
} else {
String nameString = null;
String xsdTypeLocalName = ((SDOType)propertyType).getXsdLocalName();
if (xsdTypeLocalName != null) {
nameString = xsdTypeLocalName;
} else {
nameString = propertyType.getName();
}
elem.setType(getPrefixStringForURI(propertyType.getURI()) + nameString);
}
} else {
elem.setType("anyURI");
}
if (property.isMany()) {