Package net.sf.saxon.s9api

Examples of net.sf.saxon.s9api.SchemaManager


                onwards = true;
            } else if (args[i].equals("-scm")) {
                useSCM = true;
                try {
                    Processor scmProcessor = new Processor(true);
                    SchemaManager sm = scmProcessor.getSchemaManager();
                    sm.importComponents(new StreamSource(new File(SCM_SCHEMA_LOCATION)));
                    scmValidator = sm.newSchemaValidator();
                } catch (SaxonApiException e) {
                    e.printStackTrace();
                    useSCM = false;
                }
            } else if (args[i].startsWith("-c:")) {
View Full Code Here


        test.run();
    }

    public void run() throws SaxonApiException {
        Processor processor = new Processor(true);
        SchemaManager manager = processor.getSchemaManager();

        // No resolver here, there isn't one.
        DocumentBuilder builder = processor.newDocumentBuilder();
        SAXSource source = new SAXSource(new InputSource("http://tests.xproc.org/tests/doc/compoundEntity.xml"));
        XdmNode document = builder.build(source);

        source = new SAXSource(new InputSource("http://tests.xproc.org/tests/doc/document.xsd"));
        XdmNode schema = builder.build(source);
        manager.load(schema.asSource());

        XdmDestination destination = new XdmDestination();
        Controller controller = new Controller(processor.getUnderlyingConfiguration());
        Receiver receiver = destination.getReceiver(controller.getConfiguration());
        PipelineConfiguration pipe = controller.makePipelineConfiguration();
        pipe.setRecoverFromValidationErrors(false);
        receiver.setPipelineConfiguration(pipe);

        SchemaValidator validator = manager.newSchemaValidator();
        validator.setDestination(destination);

        dumpTree(document, "Input");

        validator.validate(document.asSource());
View Full Code Here

    public void run() throws SaxonApiException {
        super.run();

        Processor proc = runtime.getProcessor();
        SchemaManager manager = proc.getSchemaManager();

        if (manager == null) {
            validateWithXerces();
        } else {
            validateWithSaxonSA(manager);
View Full Code Here

TOP

Related Classes of net.sf.saxon.s9api.SchemaManager

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.