Code example for Validator

Methods: validate

0
            return false; 
        } 
 
        try { 
            Validator validator = schema.newValidator();
            validator.validate(new StreamSource(filename));
            return true; 
        } catch (Exception ex) {
            return false; 
        } 
    } 
 
    public ActionCascade createActionCascade() { 
        Document doc;
        try { 
            DocumentBuilder dBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            doc = dBuilder.parse(new File(filename));
            doc.getDocumentElement().normalize();
        } catch (Exception ex) {
            LogUtil.logError("XML-Parsing of " + filename + " failed.", ex); //$NON-NLS-1$ //$NON-NLS-2$
            return null;