×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    12

    TinyXML and kXML parser of J2ME version needed

    Hello Everyone

    I need the J2ME version of TinyXML and kXML parser.

    I got TinyXML and kXML from sourceforge, but they did not works for me.

    If anyone help me sending the download link for kXML and TinyXML , i will be profoundly grateful to you.

    Help me, Please.

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: TinyXML and kXML parser of J2ME version needed

    what do you mean "they did not work"? if you got kXML from sourceforge, there is a good chance you actually got the version you are looking for, kXML is made for JavaME.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    12

    Re: TinyXML and kXML parser of J2ME version needed

    Hi njzk2

    Thanks for your reply.

    If i run the project it shows me the following error

    Error verifying method org/kxml2/io/KXmlParser <init>()V
    Approximate bytecode offset 70: Inconsistent or missing stackmap at target
    ALERT: java/lang/VerifyError: org/kxml2/io/KXmlParser.


    I have debugged the code and i saw that the error is generated in the following line:

    KXmlParser parser = new KXmlParser();

    Do i need to add SAX library to run along with kXML ?

    Thanks

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: TinyXML and kXML parser of J2ME version needed

    you may have to preverify it first. there is a tool in wtk for that. (but that should be done by your IDE)

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    12

    Re: TinyXML and kXML parser of J2ME version needed

    Hi njzk2

    I have solved the problem. I added the org folder of source code of kxml2-src-2.3.0 in my project source. The problem is no more.

    And i read the XML file as follows:
    DataInputStream dis = new DataInputStream(getClass().getResourceAsStream( "/NewsXML.xml"));
    KXmlParser parser = new KXmlParser();
    InputStreamReader isr = new InputStreamReader(dis);
    parser.setInput(isr);
    parser.nextTag();
    parser.require(XmlPullParser.START_TAG, null, "info");


    If I convert the isr to string and print it. It shows the following output:
    java.io.InputStreamReader@eaa14fce

    And if i debug the program the line parser.nextTag(); shows following NullPointerException:

    java.lang.NullPointerException
    at java.io.DataInputStream.read(+7)
    at com.sun.kvem.cldc.i18n.j2me.GenericReader.read(+78)
    at java.io.InputStreamReader.read(+56)
    at org.kxml2.io.KXmlParser.peek(+77)
    at org.kxml2.io.KXmlParser.peekType(+5)
    at org.kxml2.io.KXmlParser.nextImpl(+259)
    at org.kxml2.io.KXmlParser.next(+23)
    at org.kxml2.io.KXmlParser.nextTag(+4)
    at newsreader.NewsReader.newsHeader(+81)
    at newsreader.NewsReader.startApp(+57)
    at javax.microedition.midlet.MIDletProxy.startApp(+7)
    at com.sun.midp.midlet.Scheduler.schedule(+270)
    at com.sun.midp.main.Main.runLocalClass(+28)
    at com.sun.midp.main.Main.main(+80)


    Help me with some solution, Please.

Similar Threads

  1. How to use the kxml parser
    By dhiraj.deka in forum Mobile Java General
    Replies: 7
    Last Post: 2009-11-03, 16:16
  2. kXML XML Parser versus Jsr172 API Parser
    By javame.developer in forum Mobile Java General
    Replies: 1
    Last Post: 2008-02-14, 20:23
  3. kxml parser problem!
    By kamoda_pawel in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2007-02-26, 12:09
  4. Replies: 2
    Last Post: 2003-11-10, 11:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×