} else {
cache.type = ((ComplexTypeHandler) child).compress(parent);
}
if (ref != null) {
Element e = parent.lookUpElement(ref);
if (e == null) {
throw new SAXException("Element '" + ref
+ "' was referenced and not found");
}
cache.name = e.getName();
cache.type = e.getType();
if ((defaulT == null) || "".equalsIgnoreCase(defaulT)) {
cache.defaulT = e.getDefault();
}
if ((fixed == null) || "".equalsIgnoreCase(fixed)) {
cache.fixed = e.getFixed();
}
if (block == 0) {
cache.block = e.getBlock();
}
if (finaL == 0) {
cache.finaL = e.getFinal();
}
cache.minOccurs = (minOccurs == 1) ? e.getMinOccurs() : minOccurs;
cache.maxOccurs = (maxOccurs == 1) ? e.getMaxOccurs() : maxOccurs;
if (substitutionGroup != null) {
cache.substitutionGroup = e.getSubstitutionGroup();
}
}
// TODO add constraint checking