Java XML Attribute Get getAttributeValue(NamedNodeMap attributes, String name)

Here you can find the source of getAttributeValue(NamedNodeMap attributes, String name)

Description

get Attribute Value

License

Open Source License

Declaration

private static String getAttributeValue(NamedNodeMap attributes, String name) 

Method Source Code

//package com.java2s;
/*************************************************************************************
 * Copyright (c) 2008-2011 Red Hat, Inc. and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * //  w w w .  ja v a  2  s.c om
 * Contributors:
 *     JBoss by Red Hat - Initial implementation.
 ************************************************************************************/

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

public class Main {
    private static String getAttributeValue(NamedNodeMap attributes, String name) {
        String value = null;
        Node node = attributes.getNamedItem(name);
        if (node != null) {
            value = node.getNodeValue();
        }
        return value;
    }
}

Related

  1. getAttributeValue(final Node candidate, final String attributName)
  2. getAttributeValue(final Node iNode, final String iAttributeName)
  3. getAttributeValue(final Node node, final String attributeName)
  4. getAttributeValue(final Node node, final String name)
  5. getAttributeValue(final XMLStreamReader reader, final String name)
  6. getAttributeValue(Node element, String attribute)
  7. getAttributeValue(Node element, String attribute)
  8. getAttributeValue(Node htmlForm, String attributeName)
  9. getAttributeValue(Node iNode, String iAttributeName)