Java XML Attribute Get getAttributeList(NamedNodeMap attributeMap)

Here you can find the source of getAttributeList(NamedNodeMap attributeMap)

Description

a concatenated list of the node's attributes.

License

MIT License

Parameter

Parameter Description
attributeMap maps names to nodes

Return

list of attributes

Declaration

public static String getAttributeList(NamedNodeMap attributeMap) 

Method Source Code

//package com.java2s;
/** Copyright by Barry G. Becker, 2000-2011. Licensed under MIT License: http://www.opensource.org/licenses/MIT  */

import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

public class Main {
    /**// w w  w . j av a 2s . c om
     * a concatenated list of the node's attributes.
     * @param attributeMap maps names to nodes
     * @return list of attributes
     */
    public static String getAttributeList(NamedNodeMap attributeMap) {
        String attribs = "";
        if (attributeMap != null) {
            attributeMap.getLength();

            for (int i = 0; i < attributeMap.getLength(); i++) {
                Node n = attributeMap.item(i);
                attribs += n.getNodeName() + "=\"" + n.getNodeValue() + "\"  ";
            }
        }
        return attribs;
    }
}

Related

  1. getAttributeIgnoreCase(Element element, String string)
  2. getAttributeIntArray(final Node node, final String attribname)
  3. getAttributeInteger(String filename, Element parent, String name)
  4. getAttributeInteger(String filename, Element parent, String name)
  5. getAttributeIntValue(Node n, String item, int dflt)
  6. getAttributeMap(final Node node)
  7. getAttributeMap(NamedNodeMap nodeMap)
  8. getAttributeMap(XMLEvent evt)
  9. getAttributeMap(XMLStreamReader xmlStreamReader)