Here you can find the source of attributeOrNull(Node node, String... attributes)
static String attributeOrNull(Node node, String... attributes)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Node; public class Main { 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(); }/*from w w w.j ava 2 s . c o m*/ return null; } }