Package org.iso_relax.verifier

Examples of org.iso_relax.verifier.VerifierFilter


       
        // evaluate the body using the current Verifier
        if ( errorHandler != null ) {
            // we are redirecting errors to another handler
            // so just filter the body
            VerifierFilter filter = verifier.getVerifierFilter();    
           
            // now install the current output in the filter chain...
            // ####
           
            ContentHandler handler = filter.getContentHandler();
            handler.startDocument();
            invokeBody( new XMLOutput( handler ) );
            handler.endDocument();
            valid = filter.isValid();           
        }
        else {
          // outputting the errors to the current output
          verifier.setErrorHandler(
              new ErrorHandler() {
View Full Code Here


            private ContentHandler setupPipeline( Schema schema ) throws SAXException {
                try {
                    Verifier v = schema.newVerifier();
                    v.setErrorHandler(getController());
                    v.setEntityResolver(getController());
                    VerifierFilter filter = v.getVerifierFilter();
                    filter.setContentHandler(reader[0]);
                    return (ContentHandler)filter;
                } catch( VerifierConfigurationException vce ) {
                    throw new SAXException(vce);
                }
            }
View Full Code Here

        } else {
            Schema schema = getSchemaForSchema();
            final boolean[] error = new boolean[1];
           
            // set up a pipe line so that the file will be validated by s4s
            VerifierFilter filter = schema.newVerifier().getVerifierFilter();
            filter.setErrorHandler( new ReportErrorHandler() {
                public void error( SAXParseException e ) throws SAXException {
                    super.error(e);
                    error[0]=true;
                }
                public void fatalError( SAXParseException e ) throws SAXException {
                    super.fatalError(e);
                    error[0]=true;
                }
            });
           
            filter.setContentHandler(reader);
            parser.setContentHandler((ContentHandler)filter);
           
            if( error[0]==true )        return null;
        }
View Full Code Here

                System.out.println("WARNING: " + e);
            }
        });

        // now install the verifying filter
        VerifierFilter filter = verifier.getVerifierFilter();
        SAXReader reader = new SAXReader();
        reader.setXMLFilter(filter);
        return reader;
    }
View Full Code Here

       
        // evaluate the body using the current Verifier
        if ( errorHandler != null ) {
            // we are redirecting errors to another handler
            // so just filter the body
            VerifierFilter filter = verifier.getVerifierFilter();    
           
            // now install the current output in the filter chain...
            // ####
           
            ContentHandler handler = filter.getContentHandler();
            handler.startDocument();
            invokeBody( new XMLOutput( handler ) );
            handler.endDocument();
            valid = filter.isValid();           
        }
        else {
          // outputting the errors to the current output
          verifier.setErrorHandler(
              new ErrorHandler() {
View Full Code Here

            private ContentHandler setupPipeline( Schema schema ) throws SAXException {
                try {
                    Verifier v = schema.newVerifier();
                    v.setErrorHandler(getController());
                    v.setEntityResolver(getController());
                    VerifierFilter filter = v.getVerifierFilter();
                    filter.setContentHandler(reader[0]);
                    return (ContentHandler)filter;
                } catch( VerifierConfigurationException vce ) {
                    throw new SAXException(vce);
                }
            }
View Full Code Here

TOP

Related Classes of org.iso_relax.verifier.VerifierFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.