Java / Pocket PC Xml Parsing

Posted on 2006-04-03
Last Modified: 2010-03-31

I am developing a CDC/Personal Profile 1.0 application which is to run on Pocket PC 2003. I need to parse xml. For that i am using kxml.

The JVM i am using is CrE-ME 4.1

I used the follwing code to parse xml (tried from the string as well as from file).

XmlParser parser = null ;
String xml =  "<channel><item><title>Reader</title><link></link><description>Reader are used to read tag information</description></item></channel>" ;
 Reader reader = new StringReader(xml) ;
      parser = new XmlParser(reader);
catch(Exception ex)
     //log error to file.

//log message: xml doc loaded.

But after this line is hit "parser = new XmlParser(reader);", there is no exception being thrown nor any code after that is executing.

I tried putting the kxml jar in the Creme's lib folder, but the result is the same.

Thanks in advance
Question by:prashant_it
    LVL 86

    Expert Comment

    Don't you have to call parser.parse()?

    Author Comment


    No. i am using the following code after that "parser = new XmlParser(reader);"

    ParseEvent pe = null;
    parser.skip();, null, "channel");    
    pe =;
    LVL 86

    Expert Comment

    Think it should be more like

    pe =, null, "channel");    
    String text = pe.getText();

    Author Comment

    I am using pe.getText() to read.

    But the problem is after the line "parser = new XmlParser(reader);" no code is executing. I checked it by giving some logging comments.
    Also no exception is being thrown.

    Author Comment


    I found the solution to the problem.

    Actually the kxml i had downloaded form the site was in .zip format.
    I renamed it to .jar and it worked.

    Please tell me how to get my points refunded.

    LVL 86

    Expert Comment

    >>Actually the kxml i had downloaded form the site was in .zip format.

    How did you compile it then?

    Accepted Solution

    PAQed with points refunded (50)

    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    twoTwo  challenge 35 71
    sumHeights2  challenge 7 50
    countHi challenge 25 57
    count11 challenge 6 30
    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now