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 org.w3c.dom.Element;

import org.w3c.dom.NodeList;

public class Main {
    /**
     * Extract the node string representation.
     * 
     * @param nodeList
     * @return
     */
    public static String getXmlNodeAttribute(String attributeName, NodeList nodeList) {
        String retObj = null;

        if (nodeList != null && nodeList.getLength() > 0) {
            Element element = (Element) nodeList.item(0);
            retObj = element.getAttribute(attributeName);
        }
        return retObj;
    }
}