Mike Flynn
Mike Flynn

Reputation: 24325

Check If String Is Valid XML with Jdom2

What is the best way to check if a string is valid XML for Jdom2?

Upvotes: 0

Views: 298

Answers (1)

rolfl
rolfl

Reputation: 17707

Put it in a try/catch block and parse it with JDOM 2..... then if you need to handle the JDOMException it is not valid.

rolfl

Upvotes: 1

Related Questions