Here you can find the source of getElementTagName(final Node aNode)
Parameter | Description |
---|---|
aNode | A DOM Node. |
public static String getElementTagName(final Node aNode)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /**/* w w w .jav a2 s .c o m*/ * Retrieves the TagName for the supplied Node if it is an Element, and null otherwise. * * @param aNode A DOM Node. * @return The TagName of the Node if it is an Element, and null otherwise. */ public static String getElementTagName(final Node aNode) { if (aNode != null && aNode.getNodeType() == Node.ELEMENT_NODE) { final Element theElement = (Element) aNode; return theElement.getTagName(); } // The Node was not an Element. return null; } }