Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 *  Copyright (C) 2014 Ingenic Semiconductor
 *
 *  Zhouzhiqiang <zhiqiang.zhou@ingenic.com>
 *
 *  Elf/IDWS Project
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 2 of the License, or (at your
 *  option) any later version.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

import org.w3c.dom.Element;

import org.w3c.dom.Node;

public class Main {

    public static String getNodeContent(String NodeRawname, Element element) {
        Node tmpNode = element.getElementsByTagName(NodeRawname).item(0);
        if (tmpNode != null)
            return tmpNode.getTextContent().trim();
        else
            return null;
    }
}