private static int getXmlIntegerAttribute(Element spec, String attributeName) {
        String value = (spec == null) ? null : spec.getAttribute(attributeName);
        if (value == null || value.isEmpty()) {
            return 0;
        } else {
            try {
                return Integer.parseInt(value);
            } catch (NumberFormatException e) {
                throw new IllegalArgumentException
                        ("Illegal format for attribute '" + attributeName + "' at node " +
                                XML.getNodePath(spec, " > ") + ", must be an integer", e);
            }
        }
    }
Gets an integer attribute value from a service's spec

@param spec          XML element
@param attributeName nam of attribute to get value from
@return value of attribute, or 0 if it does not exist or is empty
config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/VespaDomBuilder.java