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

    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 ="");

    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; 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
    Rep Power

    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, 04: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, 08:20 AM
  3. convert html page to pdf
    By MarkWilson in forum Advanced Java
    Replies: 2
    Last Post: 09-03-2008, 12:14 AM
  4. convert html to text using java
    By in forum New To Java
    Replies: 1
    Last Post: 11-14-2007, 03:08 PM
  5. convert html to plain text
    By vissu007 in forum New To Java
    Replies: 3
    Last Post: 07-07-2007, 03: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