Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Regular Contributor
Zenkology
Posts: 90
Registered: ‎01-31-2012
My Carrier: vodafone

xml parsing using sax

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

Please use plain text.
Developer
peter_strange
Posts: 17,701
Registered: ‎07-14-2008

Re: xml parsing using sax

Have you searched this forum?

 

I think you will find sample code here.

Please use plain text.
Regular Contributor
Zenkology
Posts: 90
Registered: ‎01-31-2012
My Carrier: vodafone

Re: xml parsing using sax

yeah I have searched but I didn't find ,if you can give me link please do
Please use plain text.
Developer
peter_strange
Posts: 17,701
Registered: ‎07-14-2008

Re: xml parsing using sax

If you search for SAX, the first linkhas some sample code in it.  Does that help?

Please use plain text.
Regular Contributor
Zenkology
Posts: 90
Registered: ‎01-31-2012
My Carrier: vodafone

Re: xml parsing using sax

I feel sorry , but actually it didn't help me
Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008

Re: xml parsing using sax

If that doesn't help, then you need to ask a specific question.

 

Please use plain text.
Regular Contributor
Zenkology
Posts: 90
Registered: ‎01-31-2012
My Carrier: vodafone

Re: xml parsing using sax

if I have xml like
<category>
<feed>feed1</feed>
<feed>feed2</feed>
</category>
on a server how can I parse that to view it on my blackberry device
Please use plain text.
Developer
peter_strange
Posts: 17,701
Registered: ‎07-14-2008

Re: xml parsing using sax

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-Development/Use-the-XML-Parser/ta-p/445210

 

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. 

Please use plain text.
Regular Contributor
Zenkology
Posts: 90
Registered: ‎01-31-2012
My Carrier: vodafone

Re: xml parsing using sax

I saw xmldemo and the dom parser but I need to know the sax parser
Please use plain text.
Developer
peter_strange
Posts: 17,701
Registered: ‎07-14-2008

Re: xml parsing using sax

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.

Please use plain text.