# Sample code to convert HTML to XML in Java

 0 Hi, I want a sampple code to convert my html file to XML using chilkat. The links provided in the documentation for Example#1, 2 & 3 are broken. I am trying the following code but its not giving me the results: import com.chilkatsoft.CkHtmlToXml; import com.chilkatsoft.CkByteData; import com.chilkatsoft.CkString; public class TestingCodes { static { try { System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load.\n" + e); System.exit(1); } } public static void main(String[] args) { System.out.println("Starting conversion"); CkHtmlToXml obj = new CkHtmlToXml(); obj.UnlockComponent("anything for 30-day trial"); try{ boolean b = obj.ConvertFile("C:\\Users\\user\\Desktop\\index.html", "C:\\Users\\user\\Desktop\text_op.xml"); if(b) System.out.println("Converted successfully!"); else System.out.println("Error in converting"); } catch(Exception e){ e.printStackTrace(); } } }  The output is: " error in converting" I am working with jdk 7 and I've installed the JDK 7 version for chilkat 64 bit, ran the runTest.bat, which in turn logged the version as 9.5.0.45 on cmd. Is there anything I am missing in the procedure to make it working? asked Nov 13 '14 at 01:27 AakashJ 1●1

 0 The examples have been restored on the website. To get information about the problem, examine the contents of the obj.LastErrorText after calling obj.ConvertFile. answered Nov 14 '14 at 11:49 chilkat ♦♦ 12.2k●316●360●435
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or __italic__
• **bold** or __bold__
• 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:

×104
×62
×26
×22

Asked: Nov 13 '14 at 01:27

Seen: 2,214 times

Last updated: Nov 14 '14 at 11:49