private static String getStringValue(String attrName, Map<String, String> runtimeAttributes, Node docElement) {
        String stringValue = runtimeAttributes.get(attrName);
        if (stringValue == null) {
            Node staleNode = docElement
                    .getAttributes()
                    .getNamedItem(attrName);
            if (staleNode != null) {
                stringValue = staleNode.getNodeValue();
            }
        }
        return stringValue;
    }
Get a long value.  Try the runtime attributes first and then back off to
the document element.  Throw a RuntimeException if the attribute is not
found or if the value is not parseable as a long.

@param attrName          attribute name to find
@param runtimeAttributes runtime attributes
@param docElement        correct element that should have specified attribute
@return specified long value
tika-batch/src/main/java/org/apache/tika/util/XMLDOMUtil.java