Results 1 to 2 of 2
  1. #1
    nijil is offline Member
    Join Date
    Feb 2010
    Posts
    14
    Rep Power
    0

    Default help to convert html to xml....really urgent

    i want to convert a html file or url to xml and jst print .....i wrote this

    import org.jdom.Document;
    import org.jdom.input.SAXBuilder;
    import org.jdom.Element;
    import org.jdom.output.XMLOutputter;
    public class testerr {

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

    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build("http://en.wikipedia.org/wiki/Hadoop");

    XMLOutputter outputter = new XMLOutputter();
    outputter.output(doc, System.out);
    }
    }




    but it has that excetion error...DTD problem.....that is wat i figure out the problem is ......i guess



    then i searched for soln and saw entityresolver....and also got a jar file from google codes....but i haven't understood what it is and how to use it 4 above purpose.....can anyone explain it pls......
    and one more thing does...
    import org.xml.sax.SAXException;...........is this imported on line ...if it is is there anyway to put it into our harddisk and then include it??

    thanx in advance

  2. #2
    javanar is offline Member
    Join Date
    Feb 2010
    Posts
    4
    Rep Power
    0

    Default html not equals to xml

    html structure is not the same as xml. that is why xhtml exists.

    look for open source html parsers for java.

    html tidy is one of them.

Similar Threads

  1. Convert xml to html using ant build
    By ketvaid1 in forum XML
    Replies: 1
    Last Post: 01-19-2010, 03:25 AM
  2. How can I include a html file in html textarea?
    By surya_dks in forum New To Java
    Replies: 2
    Last Post: 10-04-2008, 07:20 AM
  3. convert html page to pdf
    By MarkWilson in forum Advanced Java
    Replies: 2
    Last Post: 09-02-2008, 11:14 PM
  4. convert html to text using java
    By praveen@asia-mail.com in forum New To Java
    Replies: 1
    Last Post: 11-14-2007, 02:08 PM
  5. convert html to plain text
    By vissu007 in forum New To Java
    Replies: 3
    Last Post: 07-07-2007, 02:39 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
  •