Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.List;

import org.w3c.dom.Element;

public class Main {
    public static Element getElementByAttributeValue(List<Element> elements, String attName, String attValue) {
        for (Element e : elements) {
            String s = e.getAttribute(attName);
            if (attValue.equals(s))
                return e;
        }
        return null;
    }
}