With SAX Parser, get an attribute's value With SAX Parser, get an attribute's value xml xml

With SAX Parser, get an attribute's value


use

attributes.getValue(i);

instead of

attributes.getQName(i);

because as doc says :

getQName :Return an attribute's qualified (prefixed) name.

getValue : Look up an attribute's value by qualified (prefixed) name.

see this example for getting attribute name and value


 @Overridepublic void startElement(String uri, String localName, String qName,        Attributes attributes) throws SAXException {     if(localName.equalsIgnoreCase("item")){        //currentMessage.setMediaUrl(attributes.getValue(BaseFeedParser.Url));                     String valueis=attributes.getValue("name")    }    super.startElement(uri, localName, qName, attributes);}