0

Do you know of any JS library that converts HTML->XML?

And not only clean HTML, but also malformed (or 'dirty') real world HTML?

Is such a library available in JS or do I have to go in for a server side library (like in Java etc)?

5
  • html is xml, do you have a particular specification you have to validate against? Commented Jun 3, 2012 at 0:29
  • 2
    @Sinetheta, XHTML is XML. HTML is not XML. Commented Jun 3, 2012 at 0:32
  • change the doctype to xhtml and then you have a xml file. Commented Jun 3, 2012 at 0:37
  • Does the resulting XML need to be valid? Commented Jun 3, 2012 at 0:47
  • Yes it does need to be valid... Commented Jun 3, 2012 at 2:06

1 Answer 1

3

There are several forgiving HTML parsing JS libraries targeted to Node, but should work in the browser if you really need that.

You could combine one of those with something that outputs XML from JS 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.