Java XML Attribute from Node getXmlNodeAttribute(String attributeName, NodeList nodeList)

Here you can find the source of getXmlNodeAttribute(String attributeName, NodeList nodeList)

Description

Extract the node string representation.

License

Open Source License

Parameter

Parameter Description
nodeList a parameter

Declaration

public static String getXmlNodeAttribute(String attributeName, NodeList nodeList) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Element;

import org.w3c.dom.NodeList;

public class Main {
    /**/*from   w w  w.j av a2 s. c  o m*/
     * Extract the node string representation.
     * 
     * @param nodeList
     * @return
     */
    public static String getXmlNodeAttribute(String attributeName, NodeList nodeList) {
        String retObj = null;

        if (nodeList != null && nodeList.getLength() > 0) {
            Element element = (Element) nodeList.item(0);
            retObj = element.getAttribute(attributeName);
        }
        return retObj;
    }
}

Related

  1. getValueForAttribute(Node currentNode, String attributeName)
  2. getXMLDate(Element e, String attrName)
  3. getXMLDate(Element e, String attrName)
  4. getXMLInt(Element e, String attrName)
  5. getXMLInt(Element e, String attrName)
  6. getXmlNodeAttributeValue(Node NN, String AttrName)
  7. getYesNoAttrVal(final NamedNodeMap nnm, final String name)
  8. hasAttribByName(Element node, String name)
  9. parseAttribute(Node lnNode, String attributeName)