Question

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

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top