Java XML Attribute Get getAttr(Node n, String name)

Here you can find the source of getAttr(Node n, String name)

Description

get Attr

License

LGPL

Declaration

public static String getAttr(Node n, String name) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import org.w3c.dom.*;

public class Main {
    public static String getAttr(Node n, String name) {
        if (n == null)
            return null;

        Node nn = n.getAttributes().getNamedItem(name);
        if (nn != null)
            return nn.getNodeValue();
        return null;
    }/*  w  ww. ja  v  a  2  s.  c  om*/
}

Related

  1. getAttr(Element elem, String name)
  2. getAttr(final Node n, final String attr)
  3. getAttr(final Node n, final String attrName)
  4. getAttr(NamedNodeMap attrs, String name)
  5. getAttr(NamedNodeMap attrs, String name, String missing_err)
  6. getAttr(Node node, String attr)
  7. getAttr(Node node, String name)
  8. getAttr(Node node, String name, String defaultValue)
  9. getAttrBool(Node n, String name)