}
}
public static int getIntegerAttribute(Element element, String name) throws Exception {
if (!element.hasAttribute(name)) {
throw new LocatedException("Missing attribute " + name + " on element " + element.getLocalName(), LocationAttributes.getLocation(element));
} else {
String value = element.getAttribute(name);
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {
throw new LocatedException("Invalid integer value " + value + " in attribute " + name, LocationAttributes.getLocation(element));
}
}
}