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

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

Description

get Attribute

License

Apache License

Declaration

public static String getAttribute(Node node, String name) 

Method Source Code

//package com.java2s;
// Licensed to the Apache Software Foundation (ASF) under one

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

public class Main {
    public static String getAttribute(Node node, String name) {
        NamedNodeMap attributes = node.getAttributes();
        Node attrNode = attributes.getNamedItem(name);
        if (attrNode != null)
            return attrNode.getNodeValue();
        return null;
    }/* www .java2  s  .  c  om*/
}

Related

  1. getAttribute(Node node, String localName, String namespaceURI)
  2. getAttribute(Node node, String localName, String namespaceURI)
  3. getAttribute(Node node, String name)
  4. getAttribute(Node node, String name)
  5. getAttribute(Node node, String name)
  6. getAttribute(Node node, String name)
  7. getAttribute(Node node, String name)
  8. getAttribute(Node node, String name)
  9. getAttribute(Node node, String name)