Java XML Attribute Get getDirectAttribute(Node node, String name)

Here you can find the source of getDirectAttribute(Node node, String name)

Description

get Direct Attribute

License

Open Source License

Declaration

public static Node getDirectAttribute(Node node, String name) 

Method Source Code

//package com.java2s;

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

public class Main {
    public static Node getDirectAttribute(Node node, String name) {
        Node attribute = null;//w ww  .  j av  a 2  s  .c om

        NamedNodeMap attributes = node.getAttributes();
        if (attributes != null) {
            attribute = attributes.getNamedItem(name);
        }

        return attribute;
    }
}

Related

  1. getBooleanAttributeValue(Node node, String attribute)
  2. getCascadeValue(final Element elem, final String attrName)
  3. getClosestAncestorWithAttribute(Node node, String ancestorName, String attributeName)
  4. getClosestAncestorWithAttribute(Node node, String ancestorName, String attributeName)
  5. getCurrentLevelAttributeTextValue(Element ele, String attribute)
  6. getDivHeadAttr(Element annotU, String attrName)
  7. getDoubleArrayTagAttribute(XMLStreamReader xmler, String attribute, double[] defaultValue)
  8. getDoubleAttribute(Element element, String name)
  9. getDoubleAttribute(Node n, String s)