"Cannot have elements within elements that have a CDATA " +
"content model");
}
String name = element.getName();
ETD etd = dtd.getETD(name);
ElementModel model = etd.getElementModel();
inCDATAElement = (model == ElementModel.CDATA);
boolean childless = element.isEmpty();
boolean elementHasEmptyModel = (model == ElementModel.EMPTY);
// If the element has no children, is always empty and has an optional
// end tag then the end tag must not be written out and the element
// must not be closed in any way.
//
// See http://www.w3.org/TR/html4/intro/sgmltut.html for more details.
boolean allowClose = true;
if (childless && elementHasEmptyModel && etd.isEndTagOptional()) {
allowClose = false;
// Override the closeEmpty value to prevent an empty tag from being
// written out.
elementHasEmptyModel = false;