Here you can find the source of findNextElementWithAttribute(Node ret, String name, String attribute, String value)
public static Element findNextElementWithAttribute(Node ret, String name, String attribute, String value)
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static Element findNextElementWithAttribute(Node ret, String name, String attribute, String value) { ret = ret.getNextSibling();/* w ww .j ava 2 s. c o m*/ while (ret != null && (!(ret instanceof Element) || !ret.getNodeName().equals(name) || ((Element) ret).getAttribute(attribute) == null || !((Element) ret) .getAttribute(attribute).equals(value))) { ret = ret.getNextSibling(); } return (Element) ret; } }