read with SAxParser
hi everyone I try to read the information of this direction
http://finance.yahoo.com/d/quotes.csv?s=XOM+BBDb.TO+JNJ+MSFT&f=snd1l1yr
SAXParserFactory factory= SAXParserFactory.newInstance();
try {
SAXParser parser= factory.newSAXParser();
RssHandler handler= new RssHandler();
parser.parse(this.getInputStre开发者_开发问答am(), handler);
return handler.getQuotes();
} catch (Exception e) {
throw new RuntimeException(e);
}
but I have this error
not well-formed (invalid token)
if I put this direction http://finance.yahoo.com/rss/headline?s=yhoo the application works well, but I need read the other direction.
any idea!!! thanks in advance.
The first URL contains something like this:
"XOM","Exxon Mobil Corpo","6/1/2011",82.03,2.14,11.89
"BBD-B.TO","BOMBARDIER INC., ","6/1/2011",6.95,1.11,16.07
"JNJ","Johnson & Johnson","6/1/2011",66.48,3.25,15.26
"MSFT","Microsoft Corpora","6/1/2011",24.43,2.44,9.94
which is CSV (comma-separated values) formatted data.
CSV is not a valid RSS feed format. It's not even XML.
精彩评论