Java XML Attribute Get getAttributeTextContent(Node node, String attiribute_name)

Here you can find the source of getAttributeTextContent(Node node, String attiribute_name)

Description

get Attribute Text Content

License

LGPL

Declaration

public static String getAttributeTextContent(Node node, String attiribute_name) 

Method Source Code


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

import org.w3c.dom.*;

public class Main {
    public static String getAttributeTextContent(Node node, String attiribute_name) {
        Node attr = node.getAttributes().getNamedItem(attiribute_name);
        if (attr != null) {
            return attr.getTextContent();
        }/*from  ww w .ja  v a 2 s . c o  m*/
        return "";
    }
}

Related

  1. getAttributeStringValue(Node htmlForm, String attributeName, String defaultValue)
  2. getAttributeStringValue(String attribute, NamedNodeMap namedNodeMap)
  3. getAttributesValues(final StartElement element)
  4. getAttributeTable(Element element)
  5. getAttributeText(final Node node, final String name)
  6. getAttributeUri(Element leaf, Element parent, String defaultBaseUri)
  7. getAttributeValue(@Nonnull final Element aElement, @Nonnull final String sAttrName)
  8. getAttributeValue(Element e, String key)
  9. getAttributeValue(Element e, String name)