Here you can find the source of getDirectAttribute(Node node, String name)
public static Node getDirectAttribute(Node node, String name)
//package com.java2s; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; public class Main { public static Node getDirectAttribute(Node node, String name) { Node attribute = null;//w ww . j av a 2 s .c om NamedNodeMap attributes = node.getAttributes(); if (attributes != null) { attribute = attributes.getNamedItem(name); } return attribute; } }