Here you can find the source of getAttributeValue(StartElement element, String namespaceURI, String localPart)
public static String getAttributeValue(StartElement element, String namespaceURI, String localPart)
//package com.java2s; //License from project: Open Source License import javax.xml.XMLConstants; import javax.xml.namespace.QName; import javax.xml.stream.events.*; public class Main { public static String getAttributeValue(StartElement element, String namespaceURI, String localPart) { QName name = new QName(namespaceURI == null ? XMLConstants.NULL_NS_URI : namespaceURI, localPart); Attribute attribute = element.getAttributeByName(name); return attribute == null ? null : attribute.getValue(); }/*from w ww . j a v a2 s . co m*/ }