gatherAllLeaves(value, contentSpec, allContent);
gatherAllLeaves(otherValue, contentSpec, allContent);
}
else if (type == XMLContentSpec.CONTENTSPECNODE_LEAF) {
// At leaf, add the element to list of elements permitted in the all
allContent.addElement(new QName(-1, value, value, otherValue), false);
}
else if (type == XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE) {
// At ZERO_OR_ONE node, subtree must be an element
// that was specified with minOccurs=0, maxOccurs=1
getContentSpec(value, contentSpec);
value = contentSpec.value;
otherValue = contentSpec.otherValue;
type = contentSpec.type;
if (type != XMLContentSpec.CONTENTSPECNODE_LEAF)
throw new CMException(ImplementationMessages.VAL_CST);
// Add the optional element to list of elements permitted in the all
allContent.addElement(new QName(-1, value, value, otherValue), true);
}
else {
throw new CMException(ImplementationMessages.VAL_CST);
}
}