Java XML Attribute Get getDoubleAttributeValue(Element element, String attribute)

Here you can find the source of getDoubleAttributeValue(Element element, String attribute)

Description

get Double Attribute Value

License

Open Source License

Declaration

public static double getDoubleAttributeValue(Element element, String attribute) 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    public static double getDoubleAttributeValue(Element element, String attribute) {
        double ret;

        Attr attr = element.getAttributeNode(attribute);

        try {/* w  w w. ja  v  a  2s .  c  o  m*/
            ret = Double.valueOf(attr.getValue());
        } catch (NumberFormatException e) {
            ret = 0d;
        }
        return ret;
    }
}

Related

  1. getDivHeadAttr(Element annotU, String attrName)
  2. getDoubleArrayTagAttribute(XMLStreamReader xmler, String attribute, double[] defaultValue)
  3. getDoubleAttribute(Element element, String name)
  4. getDoubleAttribute(Node n, String s)
  5. getDoubleAttribute(String name, Element el)
  6. getDoubleAttributeValue(final Element element, final String attributeName)