Code example for DOMError

Methods: getMessage, getSeverity

0
import org.w3c.dom.traversal.NodeFilter; 
 
public class DOMErrors implements DOMErrorHandler, LSParserFilter
{ 
	public boolean handleError(DOMError error){
		short severity = error.getSeverity();
 
		if (severity == DOMError.SEVERITY_ERROR) {
			System.out.println("[dom3-error]: "+error.getMessage());
		} 
 
		if (severity == DOMError.SEVERITY_WARNING) {
			System.out.println("[dom3-warning]: "+error.getMessage());
		} 
 
		return true; 
 
	} 
	/** 
	 * @see org.w3c.dom.ls.LSParserFilter#acceptNode(Node) 
	 */