login about faq

I tried to convert an html file to an xml file by using the ConvertFile method of the CkHtmlToXml class. However, there is no result.

Here is the Java code i tried: import com.chilkatsoft.CkHtmlToXml;

public class HTMLToXML {

static {
    try{
        System.load("D:/mydoc/JavaEclipse/html-xml/chilkat-9.4.0-jdk6-win32/chilkat.dll");
    }catch(UnsatisfiedLinkError e){e.printStackTrace();}
}
public static void main(String[] args){

    convertHTMLToXML("D:/ImageEditor.html","D:/test/ImageEditor.xml");
}

public static void convertHTMLToXML(String htmlfile, String xmlfile){

    CkHtmlToXml ck=new CkHtmlToXml();
    ck.ConvertFile(htmlfile, xmlfile);

}

}

Thank in advance

asked Jun 27 '13 at 00:03

Sovandara's gravatar image

Sovandara
1111


The ConvertFile method returns true for success and false for failure. Make sure your code checks the return value. If it fails, then examine the contents of the LastErrorText:

success = htmlToXml.ConvertFile("test.html","out.xml");
if (success != true) {
    System.out.println(htmlToXml.lastErrorText());
}
else {
    System.out.println("Success");
}
link

answered Jun 27 '13 at 12:09

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×59
×21
×20
×3

Asked: Jun 27 '13 at 00:03

Seen: 1,207 times

Last updated: Jun 27 '13 at 12:09

powered by OSQA