BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-30-2007, 01:23 PM   #1 (permalink)
New Member
 
Join Date: Aug 2007
Model: N/A
PIN: N/A
Carrier: N/A
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default XML Parsing Problem

Please Login to Remove!

I am very new to J2ME and to BlackBerry Devices. That said I am developing an application that needs to parse an xml file. I started looking through the "RIM Device Java Library 4.2.1 Release" to find out what API's would be helpful.

These caught my eye:
net.rim.device.api.xml
net.rim.device.api.xml.jaxp
net.rim.device.api.xml.parsers
org.xml.sax
org.xml.sax.helpers

but when I try and import any of these into my code I get an error "cannot find symbol". I am using JDE 4.2.1, and all the included samples run in the simulator when I click build all and run so I am guessing this is not a simple environment variable issue. Any Ideas?
Offline  
Old 08-30-2007, 02:43 PM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Oct 2006
Model: 7103
Carrier: Verizon
Posts: 259
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

try posting the whole error, maybe there's some subtext that can provide us some guidance
Offline  
Old 08-30-2007, 02:47 PM   #3 (permalink)
New Member
 
Join Date: Aug 2007
Model: N/A
PIN: N/A
Carrier: N/A
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Building SimpleWebServiceConsumer
C:\Program Files\Research In Motion\BlackBerry JDE 4.2.1\bin\rapc.exe -quiet import="..\..\..\Program Files\Research In Motion\BlackBerry JDE 4.2.1\lib\net_rim_api.jar";SimpleWebServiceConsume r\JAXP_14_FCS.jar codename=SimpleWebServiceConsumer\SimpleWebService Consumer SimpleWebServiceConsumer\SimpleWebServiceConsumer. rapc warnkey=0x52424200;0x52435200;0x52525400 C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\img\tidman.png C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\SalutationScreen.java C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\SimpleWebServiceConsumer.java
C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\SalutationScreen.java:16: cannot find symbol
symbol : class jaxp
location: package net.rim.device.api.xml
import net.rim.device.api.xml.jaxp;
^
C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\SalutationScreen.java:17: cannot find symbol
symbol : class xml
location: package net.rim.device.api
import net.rim.device.api.xml;
^
C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\SalutationScreen.java:18: cannot find symbol
symbol : class parsers
location: package net.rim.device.api.xml
import net.rim.device.api.xml.parsers;
^
C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\SalutationScreen.java:19: package org.xml does not exist
import org.xml.sax;
^
C:\Projects\Blackberry\WebServiceConsumers\SimpleW ebServiceConsumer\SalutationScreen.java:20: cannot find symbol
symbol : class helpers
location: package org.xml.sax
import org.xml.sax.helpers;

I also happen to be importing these:

import java.io.*;
import javax.microedition.io.HttpConnection;
import javax.microedition.io.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;

and get no errors.
Offline  
Old 08-30-2007, 02:51 PM   #4 (permalink)
New Member
 
Join Date: Aug 2007
Model: N/A
PIN: N/A
Carrier: N/A
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also tried to work around this by downloading JAXP 1.4 from https://jaxp.dev.java.net/ and importing that into the project through project properties, but this seemed to have no effect. Granted I am a newb.

Thanks for the help.
Offline  
Old 08-31-2007, 04:51 AM   #5 (permalink)
Thumbs Must Hurt
 
Rose's Avatar
 
Join Date: Nov 2006
Location: India
Model: 9700
OS: Windows 7
Carrier: Airtel
Posts: 121
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

import net.rim.device.api.xml.parsers.SAXParserFactory;
import net.rim.device.api.xml.parsers.*;


You can parse the xml file using the above packages also..
Offline  
Old 08-31-2007, 08:25 AM   #6 (permalink)
New Member
 
Join Date: Aug 2007
Model: N/A
PIN: N/A
Carrier: N/A
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Silly me, I guess the whole time I was missing .* on the end of all those import statements. Its always something trivial in the end... Thanks for your help Rose you got me on the right track.
Offline  
Old 11-01-2007, 05:43 PM   #7 (permalink)
New Member
 
Join Date: Nov 2007
Model: 8800
PIN: N/A
Carrier: Sprint
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Does XML require a JAR file?

Hey guys,

I'm having a similar problem, except at run time.

Everything compiles perfectly, but when I run I get the following:


Starting MultiPageAppProject
Searching installed codfiles for alias 'net_rim_xml_org'
Searching uninstalled codfiles for alias 'net_rim_xml_org'
Module 'net_rim_xml_org' not found.Error starting MultiPageAppProject: Module 'net_rim_xml_org' not found.

Do I need to include an additional JAR file in order to parse XML using the Jaxp and SAX libraries?

Any help is appreciated.

Peter
Offline  
Old 11-02-2007, 01:22 AM   #8 (permalink)
Knows Where the Search Button Is
 
Join Date: Nov 2007
Model: 8700
PIN: N/A
Carrier: AT&T
Posts: 15
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default XML Parsing - Another way.

Hey guys,

You can parse your XML with KXML library and please visit Parsing XML in J2ME to see more detail.

If you need the source file or any problems please let me know.

Regards,
Vien Nguyen
Offline  
Old 11-02-2007, 04:07 AM   #9 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

kxml is slow and an unnecessary overhead, i'd recommend using the internal sax parser.
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Offline  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





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