Java XML Attribute Get getAttributeNode(Node sNode, String attribName)

Here you can find the source of getAttributeNode(Node sNode, String attribName)

Description

Decide if the node is text, and so must be handled specially

License

Open Source License

Parameter

Parameter Description
n a parameter

Declaration

public static Node getAttributeNode(Node sNode, String attribName) 

Method Source Code

//package com.java2s;

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    /**/*from w w  w .j  a  va  2 s . co m*/
     * Decide if the node is text, and so must be handled specially
     *
     * @param n
     * @return
     */
    public static Node getAttributeNode(Node sNode, String attribName) {
        NamedNodeMap attrs = sNode.getAttributes();
        if (attrs != null) {
            return attrs.getNamedItem(attribName);
        }
        return null;
    }
}

Related

  1. getAttributeMap(XMLStreamReader xmlStreamReader)
  2. getAttributeName(Field field)
  3. getAttributeNames(Element el)
  4. getAttributeNames(Element element)
  5. getAttributeNames(final Element e)
  6. getAttributeNode(Node sNode, String attribName)
  7. getAttributeNodeList(Element element, Pattern name)
  8. getAttributeNS(Element el, String namespaceURI, String localPart)
  9. getAttributeNS(Element elem, String namespace, String att)