Results 1 to 4 of 4
  1. #1
    nigina is offline Member
    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0

    Unhappy convert html to json

    Hi everyone. I'm new in java. I wanted convert html to json. I tested and in possess testing faced problem in:

    The method length() is undefined for the type JSONArray
    The method put(JSONArray) is undefined for the type JSONArray
    The method put(JSONObject) is undefined for the type JSONArray
    The method put(String) is undefined for the type JSONArray
    XML cannot be resolved
    XML cannot be resolved to a variable
    XMLTokener cannot be resolved to a type

    Pls help

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,016
    Rep Power
    20

    Default Re: convert html to json

    And what code is producing these errors?

  3. #3
    nigina is offline Member
    Join Date
    Sep 2011
    Posts
    2
    Rep Power
    0

    Default Re: convert html to json

    import java.io.IOException;
    import net.sf.json.JSONObject;
    public class Index {

    public static void main(String[] args) throws IOException {

    Wiki wiki = new Wiki();
    String l=wiki.getRenderedText("Dushanbe");
    System.out.println(l);
    JSONObject jsonObject=new JSONObject();
    System.out.print(jsonObject.put("JSON", l).toString());


    }
    }

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,016
    Rep Power
    20

    Default Re: convert html to json

    Sorry, but that code there (as posted) does not produce that output.
    Unless the Wiki class (whatever that may be) does it, but that code is not visible.

Similar Threads

  1. convert html to image
    By omsairam in forum Java 2D
    Replies: 0
    Last Post: 02-10-2011, 06:21 PM
  2. How to convert the html into lowe case
    By masterrs.mind in forum Advanced Java
    Replies: 4
    Last Post: 03-06-2010, 07:34 PM
  3. Replies: 1
    Last Post: 02-18-2010, 05:43 PM
  4. Convert xml to html using ant build
    By ketvaid1 in forum XML
    Replies: 1
    Last Post: 01-19-2010, 03:25 AM
  5. convert html page to pdf
    By MarkWilson in forum Advanced Java
    Replies: 2
    Last Post: 09-02-2008, 11:14 PM

Posting Permissions

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