rolarenfan
Mon, 09 Jun 2008 10:06:58 -0700
This will work to validate a string-value as a valid XML document:
public boolean isValid(final String value) {
try {
DocumentHelper.parseText(value);
return true;
} catch (DocumentException exn) {
return false;
}
}
Is there a better way within dom4j to do that -- i.e., some way that does not
throw an Exception (which is a pretty expensive act)?
thanks,
Paul
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user