if (containsOnlyAllowedChildren(grammarsElement, WadlXml.grammarsChildren)) {
GrammarsNode grammars = new GrammarsNode(application);
application.addGrammars(grammars);
// grammarsChildren = {includeNode, docNode}
NodeList childNodes = grammarsElement.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
if (childNodes.item(i).getNodeName().equals(WadlXml.includeNode)) {
if (!parseIncludeNode(childNodes.item(i), grammars));
}
else if (childNodes.item(i).getNodeName().equals(WadlXml.docNode)) {
if (!parseDocNode(childNodes.item(i), grammars));
}
}
}
else {
alertInvalidWadlAndRetry(GuiFactory.notifications.invalidChildren(WadlXml.grammarsNode, allowedChildren(WadlXml.grammarsChildren)));