Java XML Attribute from Element getStringAttributeValue(final Element element, final String attributeName)

Here you can find the source of getStringAttributeValue(final Element element, final String attributeName)

Description

get String Attribute Value

License

Open Source License

Declaration

public static String getStringAttributeValue(final Element element, final String attributeName) 

Method Source Code

//package com.java2s;
/*//from   ww w .j  av  a  2s.  co m
 * Copyright (c) 2000-2002 INSciTE.  All rights reserved
 * INSciTE is on the web at: http://www.hightechkids.org
 * This code is released under GPL; see LICENSE.txt for details.
 */

import org.w3c.dom.Element;

public class Main {
    /**
     * @see #getDoubleAttributeValue(Element, String)
     */
    public static String getStringAttributeValue(final Element element, final String attributeName) {
        if (null == element) {
            return null;
        }
        final String str = element.getAttribute(attributeName);
        return str;
    }
}

Related

  1. getStringAttr(Element element, String name, String def)
  2. getStringAttribute(Element e, String name, String def)
  3. getStringAttribute(Element el, String attribute)
  4. getStringAttributeValue(Element element, String attribute)
  5. getStringAttributeValue(final Element element, final String attributeName)
  6. getTagAttribute(String sTag, String sAtt, Element eElement)
  7. getTagAttribute(XMLStreamReader xmler, String attribute, String defaultValue)
  8. getTagAttributeRecursive(String sTag, String sAtt, Element eElement)
  9. getTagAttributes(Element element)