05-12-2012 12:18 PM
hey guys ,I need to make xml parser using sax I have a url for categories ,and another for Items so I need category and items beans so I want sample code of how to parse xml file using SAX ,please don't give me link to ibm sample code coz it implement record store and I can't separate it
05-12-2012 01:32 PM
Have you searched this forum?
I think you will find sample code here.
05-12-2012 01:36 PM
05-12-2012 06:51 PM
If you search for SAX, the first linkhas some sample code in it. Does that help?
05-13-2012 12:19 PM
05-13-2012 12:30 PM
If that doesn't help, then you need to ask a specific question.
05-13-2012 01:06 PM
05-13-2012 02:18 PM
If you are not bothered about using SAX, then there is plenty of other help available by searching here for standard DOM parsing. Try "xml parser" as a search string for example.
And there is this KB article, which you could find using "XML parser"
http://supportforums.blackberry.com/t5/Java-Develo
And there is the xmlDemo sample that is packaged with your tooling.
I suspect that these will help you with the problem of processing XML.
The trick then is to get it from your Server. Again there is plenty of help already on the forum if you search, and you will find httpDemo sample that is packaged with your tooling useful as well.
Ask again if you have further questions.
05-13-2012 05:04 PM
05-13-2012 06:39 PM
What is wrong with using a DOM parser?
Given that you want to use SAX, then perhaps then you can explain what Threads you have looked at, what you have tried and what you don't understand.
You can create some dummy input Stream for your test code using String, getting the 'bytes' from it, then using a ByteArrayInputStream.
SAX parsers are not BlackBerry exclusive, so you will find, if you use your favorite internet search engine, plenty of samples describing how to use SAX parsers. Look for ones based on Java 1.4 or thereabouts and you find ones that closely match what is available on the BlackBerry.