BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 04-22-2009, 04:55 AM   #1
Selvyn Prabha
New Member
 
Join Date: Apr 2009
Model: 7100T
PIN: N/A
Carrier: gmail
Posts: 3
Default How to parse an xml doc in a Blackberry application?

Please Login to Remove!

Hi,

I want to parse an xml doc using DOM parser. I have written the logic but the build fails coz i am unable to use the following in Blackberry JDE.

* java.io.FileOutputStream
* javax.xml.transform
* javax.xml.parsers

If blackberry does not support the above packages how do I parse in a blackberry application?
Will i be able to use DOM parser for Blackberry application?
Should i use the SAX parser?
Which is better for a Blackberry application SAX or DOM Parser?
Offline  
Old 04-22-2009, 07:37 AM   #2
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

I started here: How to - Use the XML Parser so the SAX parser.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 05-08-2009, 04:27 AM   #3
Selvyn Prabha
New Member
 
Join Date: Apr 2009
Model: 7100T
PIN: N/A
Carrier: gmail
Posts: 3
Default

Thanks a lot for the help!!
Offline  
Old 10-30-2009, 05:57 AM   #4
Sujit
New Member
 
Join Date: Aug 2009
Model: 8300
PIN: N/A
Carrier: email
Posts: 6
Thumbs up getting problem in storing node values in string arrary !!!!!!!!!!!!!

Thanks a ton. Its really help me..............

Last edited by Sujit; 10-30-2009 at 07:17 AM..
Offline  
Old 11-09-2009, 06:57 PM   #5
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default I'm not all the way there, yet.

Thanks for the suggestions. I am new to BB design, but I've been developing Java using some flavor of Eclipse for several years.

The Parsing part, I have implemented. I'm sure it would work if I could get it to run. The problem is that it builds fine, but when I try to run or debug it using the simulator, it tells me that the preverifier failed. It's choking on the org.w3c.dom classes. When I comment those declarations out, it will run (but not parse - no code).

Can anyone tell me what I'm doing wrong? Am I supposed to build with any special additional libraries? I'm using a standard jre6, I'm using the 4.5 version of the plug-in (though I have through 4.7 installed).

Thanks!
Offline  
Old 11-09-2009, 07:35 PM   #6
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

What is your test environment?

Simulator, device, OS Level.

Also, can you be more specific about the error message?
Offline  
Old 11-09-2009, 08:06 PM   #7
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

Thanks for the quick response!

Simulator: BB 8300
OS: XP Home
IDE: Eclipse 3.4

It builds fine, but as soon as I try to run the app in the simulator, I get this in the Problems view:

Error preverifying class com.service.XMLResponseParser
Error!: Error: preverifier failed: C:\Program Files\BlackBerry Web Tools\plugins\net.rim.eide.componentpack4.5.0_4.5. 0.16\components\bin ...

These are my imports in my rather tiny class:

import net.rim.device.api.xml.parsers.DocumentBuilder;
import net.rim.device.api.xml.parsers.DocumentBuilderFact ory;
import net.rim.device.api.xml.parsers.ParserConfiguration Exception;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

The problem I have is that when I comment out all of the code that uses the Document, InputSource, and the SAXException (and remove the imports, too), it compiles and runs fine.

Thanks, in advance...
Offline  
Old 11-09-2009, 08:38 PM   #8
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

I was referring to the device and/or simulator OS.

This sounds to me like you are compiling on 4.5 and running on an 8300 sim that has 4.2.1. You can run on a OS level at or greater than your JDE level, but not lower.

Check Options / About to get the OS level on the simulator or device.
Offline  
Old 11-09-2009, 08:48 PM   #9
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

I don't see Options / About, but I do see Help / About. It shows this:

About - BlackBerry Smartphone Simulator
---------------------------------------
BlackBerry Smartphone Simulator 2.9.0.52
Special thanks to the wxWidgets, C++ Boost, and PortAudio projects.
© 1997-2008 Research In Motion Limited

Sorry for the ignorance, but I'm new to Black Berry Dev.
Offline  
Old 11-09-2009, 08:52 PM   #10
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

If you have an 8300 sim or device then you have an Options and/or Settings icon on your main screen. Select it.

Now choose "About" from the list of options.

You should see something like:

Blackberry 8300
V4.2.2.180 (Platform 2.5.0.36)

The OS version is 4.2.2.180, in this case.

Depending on what theme you are running on the device, you may or may not need to press the MENU key to find the homescreen. On must Curve themes, the OPtions icon is a wrench.

Last edited by Dougsg38p; 11-09-2009 at 08:57 PM..
Offline  
Old 11-10-2009, 08:27 AM   #11
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

I am away from my environment, but when I get back to it this evening, I will check. How do I "upgrade" it if it is below 4.5?
Offline  
Old 11-10-2009, 08:31 PM   #12
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

Thanks for the advice and sorry for the delay. Work - then fixing two cars.

Here's what I have:

BlackBerry 8300
smartphone (EDGE)
v4.5.0.44 (Platform)
Cryptographic Kernal v3.8.5.32a
Micro Edition Configuration CLDC-1.1
Micro Edition Profile: MIDP-2.0
Micro Edition JTWI Version: 1.0
Micro Edition Media Version: 1.1
Micro Edition PIM Version: 1.0
Micro Edition File Version: 1.0

Does that help?
Offline  
Old 11-10-2009, 09:58 PM   #13
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

class com.service.XMLResponseParser

I don't recognize this as part of the RIM API - is this your class?
Offline  
Old 11-10-2009, 10:01 PM   #14
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

Yes. That's my class that has all the XML parsing code in it.
Offline  
Old 11-10-2009, 11:10 PM   #15
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

I'm at a loss. I use these classes with 4.5 and have never seen this issue.

I'm guessing that there is something messed up in your installation.
Offline  
Old 11-10-2009, 11:16 PM   #16
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

Wow. Okay. I appreciate your taking the time.

What could I have done wrong to cause this? Is there a plug-in that I might have missed? The org.w3c.dom package is standard in 1.6, isn't it?

I'll take any last second ideas you or anyone might have...
Offline  
Old 11-11-2009, 08:29 AM   #17
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

The DOM package is standard in the RIM API, but I wonder if you are resolving to the SE version of the package, rather than the RIM (ME) version?

I don't use Eclipse for BB development so I'm afraid I cannot help on the tool setup.
Offline  
Old 11-11-2009, 09:17 AM   #18
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

Hmm. That's a thought. Is that a variation in the JDK or the plug-in? My version of Eclipse is just the standard 3.4 version. I would imagine that it is just something that's installed. Is the SE vs. ME version installed directly to the OS or is it just an add-on to the IDE?
Offline  
Old 11-11-2009, 09:27 AM   #19
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Default

I'm guessing that the RIM jars come down with the RIM Blackberry pug-in, right?

Can you double-check your build path?
Offline  
Old 11-11-2009, 09:48 AM   #20
dlpbbdev
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 10
Default

I have a RIM library in my build path. How do I verify that it's the right one?
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Blackberries Advertising Vinyl Banner Flag Sign Many Sizes Available USA picture

Blackberries Advertising Vinyl Banner Flag Sign Many Sizes Available USA

$174.84



FARM FRESH BLACKBERRIES CLEARANCE BANNER Advertising Vinyl Flag Sign AAA picture

FARM FRESH BLACKBERRIES CLEARANCE BANNER Advertising Vinyl Flag Sign AAA

$174.84



Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh picture

Blackberry Advertising Banner Vinyl Mesh Sign Fruit Vegetable Berry Farm Fresh

$219.95



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL V2 picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL V2

$87.83



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL V3 picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL V3

$96.93



BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL picture

BLACKBERRY MEAD Advertising Vinyl Banner Flag Sign Many Sizes MEDIEVAL

$174.84







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.