while (attributes.hasNext()) {
OMAttribute omAttribute = (OMAttribute) attributes.next();
OMAttribute attr = elementTwo.getAttribute(
omAttribute.getQName());
if (attr == null) {
throw new XMLComparisonException(
"Attributes are not the same in two elements. Attribute " +
omAttribute.getLocalName() +
" != ");
}
elementOneAtribCount++;
}
Iterator elementTwoIter = elementTwo.getAllAttributes();
while (elementTwoIter.hasNext()) {
elementTwoIter.next();
elementTwoAtribCount++;
}
if (elementOneAtribCount != elementTwoAtribCount) {
throw new XMLComparisonException(
"Attributes are not the same in two elements.");
}
}