* @throws BuzzParsingException if a parsing error occurs.
*/
public static BuzzCommentsFeed parseComments( String xmlResponse )
throws BuzzParsingException, BuzzIOException
{
CommentsFeedHandler handler;
XMLReader xr;
try
{
xr = XMLReaderFactory.createXMLReader();
handler = new CommentsFeedHandler( xr );
xr.setContentHandler( handler );
xr.setErrorHandler( handler );
xr.parse( new InputSource( new ByteArrayInputStream( xmlResponse.getBytes( "UTF-8" ) ) ) );
}
catch ( SAXException e )
{
throw new BuzzParsingException( e );
}
catch ( IOException e )
{
throw new BuzzIOException( e );
}
return handler.getFeed();
}