×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Registered User
    Join Date
    Aug 2009
    Posts
    3

    Re: Parsing wbxml file to xml file using kxml parser

    I have found the problem for #7 post, see in red.
    Quote Originally Posted by ramyashashe View Post
    using the following code i created the wbxml file

    public byte[] getWBXMLStream(byte[] xmlData) { // xml to wbxml
    try {
    // Construct an InputStreamReader on ByterArrayInputStream.
    InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(xmlData));

    // Make parser using this Reader.
    XmlParser parser = new XmlParser(in);

    // Construct a DOM Document to parse XML.
    Document document = new Document ();
    document.parse(parser);
    in.close();

    // Make an OutputStream on which WbxmlWriter can write.
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    AbstractXmlWriter writer = new WbxmlWriter(out);
    document.write(writer);
    writer.close();

    // Get WBXML from this stream.
    xmlData = out.toString().getBytes(); //<----- This is the problem! Try out.toByteArray(); If you convert it to a String first it will mess up your bytes and the length of the String Table in the WBXML document will be wrong
    out.close();

    }//try
    catch (Exception e) { e.printStackTrace(); }
    return xmlData;
    }

    after converting using this i try to parse the wbxml file.
    Cheers,
    Gergo

  2. #17
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105

    Smile

    Thanks for updating. How could I miss that?

  3. #18
    Registered User
    Join Date
    May 2010
    Posts
    1

    Re: Parsing wbxml file to xml file using kxml parser

    I can not use <input type='file'> or open the image in Nokia Mobile Browser! It show the problem that : WBXML Parser: invalid content. Can anyone solve it for me please?

  4. #19
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    socheata, could you elaborate a bit more about your problem? Are you dealing with SVG?

Similar Threads

  1. XML Parser in C++
    By mrinal_malhotra in forum Symbian
    Replies: 4
    Last Post: 2008-11-10, 13:22
  2. Replies: 1
    Last Post: 2005-05-26, 14:22
  3. XML parsing problem in Nokia 12
    By codekiller in forum Nokia M2M
    Replies: 2
    Last Post: 2005-04-26, 09:01
  4. Replies: 0
    Last Post: 2002-06-10, 12:24
  5. XML parsing
    By Nokia_Archive in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-05-31, 19:01

Posting Permissions

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