Get the name of the XML element - Java XML

Java examples for XML:DOM Element

Description

Get the name of the XML element

Demo Code


//package com.java2s;

import org.w3c.dom.Element;

public class Main {
    /**//from  w  w  w  .  j av a2 s  .c  o  m
     * Get the name of the element
     *
     * @param element
     * @return
     */
    public static String getElementName(Element element) {
        return element.getNodeName();
    }
}

Related Tutorials