*/
public void checkMessages(XMLFile messagesDoc) throws DocumentException {
// Detector elements must all have a class attribute
// and details child element.
for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/Detector"); i.hasNext();) {
Node node = i.next();
messagesDoc.checkAttribute(node, "class");
messagesDoc.checkElement(node, "Details");
}
// BugPattern elements must all have type attribute
// and ShortDescription, LongDescription, and Details
// child elements.
for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/BugPattern"); i.hasNext();) {
Node node = i.next();
messagesDoc.checkAttribute(node, "type");
messagesDoc.checkElement(node, "ShortDescription");
messagesDoc.checkElement(node, "LongDescription");
messagesDoc.checkElement(node, "Details");
}
// BugCode elements must contain abbrev attribute
// and have non-empty text
for (Iterator<Node> i = messagesDoc.xpathIterator("/MessageCollection/BugCode"); i.hasNext();) {
Node node = i.next();
messagesDoc.checkAttribute(node, "abbrev");
messagesDoc.checkNonEmptyText(node);
}
// Check that all Detectors are described