codeString(messageTextHandler, ex.getMissingElementName());
}
messageTextString(messageTextHandler, PERIOD, false);
}
} else if (e instanceof StringNotAllowedException) {
StringNotAllowedException ex = (StringNotAllowedException) e;
messageTextString(messageTextHandler, BAD_CHARACTER_CONTENT, false);
codeString(messageTextHandler, ex.getValue());
messageTextString(messageTextHandler, FOR, false);
element(messageTextHandler, ex.getCurrentElement(), false);
emitDatatypeErrors(messageTextHandler, ex.getExceptions());
} else if (e instanceof TextNotAllowedException) {
TextNotAllowedException ex = (TextNotAllowedException) e;
messageTextString(messageTextHandler, TEXT_NOT_ALLOWED_IN, false);
element(messageTextHandler, ex.getCurrentElement(), false);
messageTextString(messageTextHandler, IN_THIS_CONTEXT, false);
} else if (e instanceof UnfinishedElementException) {
UnfinishedElementException ex = (UnfinishedElementException) e;
element(messageTextHandler, ex.getCurrentElement(), true);
if (ex.getMissingElementName() == null) {
messageTextString(messageTextHandler, IS_MISSING_A_REQUIRED_CHILD, false);
} else {
messageTextString(messageTextHandler, REQUIRED_CHILDREN_MISSING_FROM, false);
codeString(messageTextHandler, ex.getMissingElementName());
}
messageTextString(messageTextHandler, PERIOD, false);
} else if (e instanceof UnfinishedElementOneOfException) {
UnfinishedElementOneOfException ex = (UnfinishedElementOneOfException) e;
element(messageTextHandler, ex.getCurrentElement(), true);
messageTextString(messageTextHandler,
REQUIRED_CHILDREN_MISSING_ONE_OF_FROM, false);
for (Iterator<String> iter = ex.getMissingElementNames().iterator(); iter.hasNext();) {
String missingElementName = iter.next();
if (!("http://www.w3.org/1999/xhtml".equals(ex.getCurrentElement().getNamespaceUri()) && "frameset".equals(missingElementName))) {
codeString(messageTextHandler, missingElementName);
if (iter.hasNext()) {
messageTextString(messageTextHandler, COMMA, false);
}
}
}
messageTextString(messageTextHandler, PERIOD, false);
} else if (e instanceof RequiredElementsMissingOneOfException) {
RequiredElementsMissingOneOfException ex = (RequiredElementsMissingOneOfException) e;
element(messageTextHandler, ex.getParent(), true);
messageTextString(messageTextHandler,
REQUIRED_CHILDREN_MISSING_ONE_OF_FROM, false);
for (Iterator<String> iter = ex.getMissingElementNames().iterator(); iter.hasNext();) {
String missingElementName = iter.next();
if (!("http://www.w3.org/1999/xhtml".equals(ex.getCurrentElement().getNamespaceUri()) && "frameset".equals(missingElementName))) {
codeString(messageTextHandler, missingElementName);
if (iter.hasNext()) {
messageTextString(messageTextHandler, COMMA, false);
}
}
}
messageTextString(messageTextHandler, PERIOD, false);
} else if (e instanceof UnknownElementException) {
UnknownElementException ex = (UnknownElementException) e;
messageTextString(messageTextHandler, UNKNOWN, false);
element(messageTextHandler, ex.getCurrentElement(), false);
messageTextString(messageTextHandler, NOT_ALLOWED, false);
if (ex.getParent() != null) {
messageTextString(messageTextHandler, AS_CHILD_OF, false);
element(messageTextHandler, ex.getParent(), false);
}
messageTextString(messageTextHandler, PERIOD, false);
}
}
emitter.endText();