0

I am looking for an effective HTML to XHTML library in Java. I have tried HTML Tidy but it causes this error:

XML Parsing Error: mismatched tag. Expected: </meta>.

Do you recommend any better library?

I appreciate your help.

4
  • Any particular reason for using XHTML? Commented Feb 24, 2013 at 9:00
  • i want to creat a PDF document from html file but the library that i use converts the XHTML to pdf not the normal html . Commented Feb 26, 2013 at 13:52
  • you can know more about XHTML from here w3schools.com/html/html_xhtml.asp Commented Feb 26, 2013 at 14:02
  • 1
    I think I know enough about XHTML, thanks ,-) Besides, have a look at w3fools. Commented Feb 26, 2013 at 14:04

1 Answer 1

4

what do you mean by "accurate" results? html is not valid legal xml so making it into xml will obviously change it. have you tried tagsoup ? i've used it before to xml-ize html.

also, you might want to look at a few similar questions that have been asked here before

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

4 Comments

Sorry, i meant it gives me this error: XML Parsing Error: mismatched tag. Expected: </meta>.
+1 for tagsoupn which is exactly the answer to the question, even if the question is ambiguous...
sorry but i want to convert an HTML file not a web page is the "tagsoup" compatible with that ??
@mohammad - yes. just use the event stream you get from tagsoup to generate your own xhtml.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.