"</menu>" +
"</form>" +
"</xml>";
XMLReader reader = DOMUtilities.getReader();
Document dom = DOMUtilities.read(reader, domString);
VoiceXMLTransformer transformer = new VoiceXMLTransformer();
transformer.transform(createProtocol(), dom);
final Set ids = new HashSet();
RecursingDOMVisitor visitor = new RecursingDOMVisitor() {
public void visit(Element element) {
if("menu".equals(element.getName())) {
String id = element.getAttributeValue("id");
assertNotNull("menu id should not be null", id);
assertTrue("Found non-unique id: " + id,
ids.add(id));
}
element.forEachChild(this);
}
};
dom.forEachChild(visitor);
}