Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    /** Helper method - gets the local name of the node without the namespace prefix.
    The method checks to be sure that the DOM 2 interface is implemented otherwise
    an exception is thrown when the method is called.
       @param pNode A <I>org.w3c.dom.Node</I> object.
       @return the local name.
     */
    public static String getLocalName(Node pNode) {
        try {
            return pNode.getLocalName();
        } catch (NoSuchMethodError pEx) {
            return pNode.getNodeName();
        }
    }
}