Java XML Attribute from Node getXMLInt(Element e, String attrName)

Here you can find the source of getXMLInt(Element e, String attrName)

Description

get XML Int

License

Open Source License

Declaration

public static int getXMLInt(Element e, String attrName) 

Method Source Code

//package com.java2s;
// modify it under the terms of the GNU General Public License

import org.w3c.dom.Element;

public class Main {
    public static int getXMLInt(Element e, String attrName) {
        try {// w w  w .j  a v  a  2s.  c  o  m
            return Integer.parseInt(e.getAttribute(attrName));
        } catch (Exception exc) {
            return -1;
        }
    }
}

Related

  1. getStringAttributeOptional(Node node, String attributeName, String valueIfEmpty)
  2. getStringAttributeRequired(Node node, String attributeName)
  3. getValueForAttribute(Node currentNode, String attributeName)
  4. getXMLDate(Element e, String attrName)
  5. getXMLDate(Element e, String attrName)
  6. getXMLInt(Element e, String attrName)
  7. getXmlNodeAttribute(String attributeName, NodeList nodeList)
  8. getXmlNodeAttributeValue(Node NN, String AttrName)
  9. getYesNoAttrVal(final NamedNodeMap nnm, final String name)