Package com.sun.msv.schematron.verifier

Examples of com.sun.msv.schematron.verifier.RelmesVerifier$SchematronVerifier


    private final RelmesVerifier verifier;
   
    public RelamesVerifierImpl(Grammar grammar) throws VerifierConfigurationException {
        try {
            this.verifier = new RelmesVerifier(new REDocumentDeclaration(grammar),null);
        } catch( ParserConfigurationException e ) {
            throw new VerifierConfigurationException(e);
        }
    }
View Full Code Here


                factory.setNamespaceAware(true);
                Grammar grammar = SRELAXNGReader.parse( args[0], factory, new DebugController(false,false) );
                if(grammar==null)       return;
               
                // setup verifier
                RelmesVerifier verifier = new RelmesVerifier(
                        new REDocumentDeclaration(grammar), new ReportErrorHandler() );
                XMLReader reader = factory.newSAXParser().getXMLReader();
                reader.setContentHandler(verifier);
               
                try {
                for( int i=1; i<args.length; i++ ) {
                        System.out.println("validating "+args[i]);
                        reader.parse(args[i]);
                        if(verifier.isValid())
                                System.out.println("valid\n");
                        else
                                System.out.println("NOT valid\n");
                }
                } catch( SAXException e ) {
View Full Code Here

            if (grammar == null)
                throw new RuntimeException(
                        "Unexpected failure parsing grammar URL '"
                        + grammarUrl + "'");
   
            RelmesVerifier verifier;
            XMLReader reader;
            CatalogResolver catalogResolver = new CatalogResolver();
   
            for (int i = 0; i < sourceUrls.length; i++ ) {
                verifier = new RelmesVerifier(
                        new REDocumentDeclaration(grammar),
                        new ReportErrorHandler());
                reader = factory.newSAXParser().getXMLReader();
                reader.setEntityResolver(catalogResolver);
                reader.setContentHandler(verifier);
                if (verbose)
                    System.out.print("Validating " + sourceUrls[i] + "...  ");
                try {
                    reader.parse(new InputSource(sourceUrls[i].openStream()));
                } catch (SAXException e) {
                    if (verbose) System.out.println(); // See note below
                    cause = e.getCause();
                    System.err.println(
                            cause == null ? e.toString() : cause.toString());
                }
                if (verifier.isValid()) {
                    if (verbose) System.out.println("valid");
                } else {
                    exitStatus++;
                    System.err.println(sourceUrls[i] + " INVALID!");
                }
View Full Code Here

    factory.setNamespaceAware(true);
    Grammar grammar = SRELAXNGReader.parse( args[0], factory, new DebugController(false,false) );
    if(grammar==nullreturn;
   
    // setup verifier
    RelmesVerifier verifier = new RelmesVerifier(
      new REDocumentDeclaration(grammar), new ReportErrorHandler() );
    XMLReader reader = factory.newSAXParser().getXMLReader();
    reader.setContentHandler(verifier);
   
    try {
    for( int i=1; i<args.length; i++ ) {
      System.out.println("validating "+args[i]);
      reader.parse(args[i]);
      if(verifier.isValid())
        System.out.println("valid\n");
      else
        System.out.println("NOT valid\n");
    }
    } catch( org.xml.sax.SAXException e ) {
View Full Code Here

    private final RelmesVerifier verifier;
   
    public RelamesVerifierImpl(Grammar grammar) throws VerifierConfigurationException {
        try {
            this.verifier = new RelmesVerifier(new REDocumentDeclaration(grammar),null);
        } catch( ParserConfigurationException e ) {
            throw new VerifierConfigurationException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.msv.schematron.verifier.RelmesVerifier$SchematronVerifier

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.