09-09-2010 11:50 AM
Hello,
I'm trying to parse an InputStream that contains XML information with SAX.
private void parserInput(InputStream in) {
try {
SAXParserFactory saxfact = SAXParserFactory.newInstance();
SAXParser sp = saxfact.newSAXParser();
sp.parse(in, handler)
}
catch (ParserConfigurationException e) {
e.printStackTrace();
}
But i don't know exactly what do i have to do with that handler and how do i get the XML tags from the inputstream. I was used to do this in a different way but it's not working with BB JRE...
Any help please?
09-09-2010 07:41 PM
Hi,
You need to create a class that extends from DefaultHandler in order to properly parse each tag in your XML. Have you seen this thread? http://supportforums.blackberry.com/t5/Java-Develo
I'm not actually using SAX, since kXML library works great and faster. I've put a short tutorial on how to include it in your BlackBerry project here: http://www.wilkonit.com/site/component/lyftenblogg
Regards!