0

I have an HTML file which contains java script and HTML tags. I want to convert that HTML file into XML file. As XML file is used only to store data. so java script will be ignored. I want to write such type of program in java.

I have tried with the sample code from http://www.daniweb.com/software-development/java/threads/162988 but it did not work for me.

Thanks Sunil

3
  • Could you please provide a link to html page, or paste example HTML code? Commented Jun 23, 2011 at 8:13
  • @Petr how to attach that html file along with the question? Commented Jun 23, 2011 at 8:20
  • I don't know if this possible here, you can place it on some external resource though. Commented Jun 23, 2011 at 8:25

1 Answer 1

2

You should use an existing parser for that - Open Source HTML Parsers in Java seems to give a nice overview about available parsers.
After parsing the HTML, you can generate the XML from the objects.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.