×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    33

    document.parse(parser);

    hi folks

    im using Netbeans for xml parsing with j2me game. In my parse()
    function below, all are working fine .

    public void parse(){


    InputStream in = getClass().getResourceAsStream("/spinsports.xml");

    int input;
    if(in!=null)
    {

    while((input=in.read()) != -1)
    {
    buffer.append((char)input);

    }

    inputstr = buffer.toString();


    utfTempString = new String( inputstr.getBytes( "ISO-8859-1" ), "UTF-8" );
    }
    in.close();

    byte[] xmlByteArray = inputstr.getBytes();
    ByteArrayInputStream xmlStream = new ByteArrayInputStream( xmlByteArray );
    InputStreamReader xmlReader = new InputStreamReader( xmlStream );
    XmlParser parser = new XmlParser( xmlReader );
    System.out.println("....before docparse");

    try{
    document.parse(parser); // .....STRUCKS here

    }catch(Exception e){ System.out.println(e);}
    System.out.println("....after docparse");

    Element root = document.getRootElement();

    int children = root.getChildCount();


    } // end function


    My problem is ,this function is displaying "....before docparse"
    but not "....after docparse". compiling successfully.But while running the emulator is just displayed without any actions.also its not throwing any exp or error.
    If i comment that line its working fine. otherwise it just strucks in that particular line. what may be my mistake.
    plz suggest some ideas...

    for reference just check out
    http://www.informit.com/articles/art...&seqNum=7&rl=1

    thanks in advance
    yafy.
    Last edited by yafy; 2006-05-10 at 12:41.

  2. #2
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: document.parse(parser);

    Hi,

    Please check the parser u r using.ie; the parse() method.Is the KXML parser is correctly packaged
    document.parse(parser) u r using is a blocking code. So if anything goes wrong then it will not come out

    Here is another example using KXmL which may be more helpful to u
    http://developers.sun.com/techtopics...es/parsingxml/

    regards,
    Wang

  3. #3
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    55

    Re: document.parse(parser);

    Hi Folks,
    I think I have the same problem - my code gets stuck at execution in the parse(InputStream) method from sun's example:

    http://developers.sun.com/techtopic...les/parsingxml/

    I really just copied everything as it is and it doesnt work..Please give me some idea, I am desperate!

    Thx

    Nina

  4. #4
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: document.parse(parser);

    Hi,

    Please check whether the kxml package is packaged correctly with the jar file

    http://kxml.objectweb.org/

    http://kxml.objectweb.org/software/downloads/index.html


    Wang

  5. #5
    Regular Contributor
    Join Date
    Feb 2006
    Posts
    55

    Re: document.parse(parser);

    Hi

    Thx for replying. I use eclipse and carbide.j, so i just added the .zip file I downloaded from the kxml webpage to the libraries (it is in my project lib directory).

    What might be wrong with that?

    Nina

  6. #6
    Registered User
    Join Date
    Nov 2003
    Posts
    31

    Re: document.parse(parser);

    You need to change the .zip extension to a .jar extension when you put it in the lib directory of the application.

  7. #7
    Registered User
    Join Date
    Jul 2006
    Posts
    33

    Re: document.parse(parser);

    sorry for irelevant reply.
    hi nina,
    i want to contact you bt u do nt allow email any ways i want to knw did u solve the problem of graphics layer over video or camera screen please let me knw abt dat and if u solved it please tell me how can i do it if possible send me some sample code it will be great benifit for me.
    thanks in advance.
    Regards,
    Muhammad Shouab

Posting Permissions

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