Util.readXMLEscapedString(sw, sdeString);
ServiceDataElement nextSDE =
sdeFactory.newServiceDataElement(sw.toString());
QName sdeQName = nextSDE.getQName();
// make sure the SDE can be added
ServiceDataTypeMetadata sdtm = sdm.getTypeManager().getRegisteredType(sdeQName);
// 1. maxoccurs
ServiceDataElement[] sdeList = sdm.getServiceDataByName(sdeQName);
if(sdtm.getMaxOccurs() > 0 && sdeList.length >= sdtm.getMaxOccurs()) {
continue;
}
// 2. mutability
if(sdtm.getMutable() == sdtm.STATIC || sdtm.getMutable() == sdtm.CONSTANT){
continue;
}
// 3. nillability
if(!sdtm.isNillable() && nextSDE.isContentNil()) {
continue;
}
// add the SDE
sdm.addServiceData(nextSDE);
}