Java XML Attribute from Element getIntAttribute(Element el, String name)

Here you can find the source of getIntAttribute(Element el, String name)

Description

get Int Attribute

License

Open Source License

Declaration

public static int getIntAttribute(Element el, String name) 

Method Source Code

//package com.java2s;
import org.w3c.dom.Element;

public class Main {
    public static int getIntAttribute(Element el, String name) {
        String s = el.getAttribute(name);
        if (s != null && s.length() > 0) {
            return Integer.parseInt(s);
        }//w w  w .  ja  va2s .  co m
        return 0;
    }
}

Related

  1. getFloatAttribute(String name, Element el)
  2. getHeadAttr(Element annotU, String attrName)
  3. getIdAttribute(Element domElement)
  4. getIdAttributeValue(Element elem, String name)
  5. getIntAttr(Element elem, String attName)
  6. getIntAttribute(Element elem, String attName, boolean mandatory, int defaultValue)
  7. getIntAttribute(Element elem, String attName, boolean mandatory, int defaultValue)
  8. getIntAttribute(Element element, String attribute)
  9. getIntAttribute(Element element, String name, int defaultValue)