Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import org.w3c.dom.Node;

public class Main {
    public static Boolean getBooleanAttributeValue(Node node, String attribute) {
        String value = getAttributeValue(node, attribute);

        if (value == null)
            return null;

        if (value.equals("1"))
            return true;

        if (value.equals("true"))
            return true;

        return false;
    }

    public static String getAttributeValue(Node node, String attribute) {
        Node att = node.getAttributes().getNamedItem(attribute);

        if (att == null)
            return null;

        return att.getTextContent();
    }
}