int typeCount = typeNames.length;
String wrapper = (bad? "b" : "span");
String highlight = (bad? " highlight" : "");
if (typeCount > 1 || "value".equals(attributeName)) {
addText(xhtmlSaxEmitter, " ");
AttributesImpl attributesImpl = new AttributesImpl();
attributesImpl.addAttribute("class", "inputattrtypes" + highlight);
xhtmlSaxEmitter.startElement(wrapper, attributesImpl);
addText(xhtmlSaxEmitter, "when ");
xhtmlSaxEmitter.startElement("code");
addText(xhtmlSaxEmitter, "type");
xhtmlSaxEmitter.endElement("code", "code");
addText(xhtmlSaxEmitter, " is ");
if ("value".equals(attributeName)) {
addText(xhtmlSaxEmitter, "not ");
addHyperlink(xhtmlSaxEmitter, "file", SPEC_LINK_URI
+ fragmentIdByInputType.get("file"));
addText(xhtmlSaxEmitter, " or ");
addHyperlink(xhtmlSaxEmitter, "image", SPEC_LINK_URI
+ fragmentIdByInputType.get("image"));
} else {
for (int i = 1; i < typeCount; i++) {
String typeName = typeNames[i];
if (i > 1) {
addText(xhtmlSaxEmitter, " ");
}
if (typeCount > 2 && i == typeCount - 1) {
addText(xhtmlSaxEmitter, "or ");
}
addHyperlink(xhtmlSaxEmitter, typeName, SPEC_LINK_URI
+ fragmentIdByInputType.get(typeName));
if (i < typeCount - 1 && typeCount > 3) {
addText(xhtmlSaxEmitter, ",");
}
}
}
xhtmlSaxEmitter.endElement(wrapper);
} else {
AttributesImpl attributesImpl = new AttributesImpl();
attributesImpl.addAttribute("class", "inputattrtypes");
xhtmlSaxEmitter.startElement("span", attributesImpl);
xhtmlSaxEmitter.endElement("span");
}
}