Java XML Attribute Get getAttributeValue(final XMLStreamReader reader, final String name)

Here you can find the source of getAttributeValue(final XMLStreamReader reader, final String name)

Description

Fetches the attribute name from the current elements namespace.

License

Open Source License

Parameter

Parameter Description
reader active pull parser to read XML from
name name of the attribute to read the value of

Return

the value of attribute attribute

Declaration

public static String getAttributeValue(final XMLStreamReader reader, final String name) 

Method Source Code

//package com.java2s;
/********************************************************************************
 * Copyright (c) 2009 Regents of the University of Minnesota
 *
 * This Software was written at the Minnesota Supercomputing Institute
 * http://msi.umn.edu/*from w  w  w.ja  v a2s .  c o  m*/
 *
 * All rights reserved. The following statement of license applies
 * only to this file, and and not to the other files distributed with it
 * or derived therefrom.  This file is 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
 *
 * Contributors:
 * Minnesota Supercomputing Institute - initial API and implementation
 *******************************************************************************/

import javax.xml.stream.XMLStreamReader;

public class Main {
    /**
     * Fetches the attribute name from the current elements namespace.
     * 
     * @param reader
     *          active pull parser to read XML from
     * @param name
     *          name of the attribute to read the value of
     * @return the value of attribute {@code attribute}
     */
    public static String getAttributeValue(final XMLStreamReader reader, final String name) {
        return reader.getAttributeValue(null, name);
    }
}

Related

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