Here you can find the source of attribute(Node node, String... attributes)
static String attribute(Node node, String... attributes)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { static String attribute(Node node, String... attributes) { String value = attributeOrNull(node, attributes); return value == null ? "" : value; }/* www . j a va 2 s .c o m*/ static String attributeOrNull(Node node, String... attributes) { for (int i = 0; i < attributes.length; i++) { String attribute = attributes[i]; Node attr = node.getAttributes().getNamedItem(attribute); if (attr != null) return attr.getNodeValue(); } return null; } }