Package eu.scape_project.planning.xml

Examples of eu.scape_project.planning.xml.SchemaResolver


        SAXParser parser = validatingParserFactory.getValidatingParser();
        parser.setProperty(ValidatingParserFactory.JAXP_SCHEMA_SOURCE, "http://simple.org/simple/V1.0.0/simple.xsd");

        parser.parse(
            inPlan,
            new StrictDefaultHandler(new SchemaResolver().addSchemaLocation(
                "http://simple.org/simple/V1.0.0/simple.xsd", "simple/simple.xsd")));
    }
View Full Code Here


        SAXParser parser = validatingParserFactory.getValidatingParser();
        parser.setProperty(ValidatingParserFactory.JAXP_SCHEMA_SOURCE, "http://simple.org/simple/V1.0.0/simple.xsd");
        parser.parse(
            inPlan,
            new StrictDefaultHandler(new SchemaResolver().addSchemaLocation(
                "http://simple.org/simple/V1.0.0/simple.xsd", "simple/simple.xsd")));
    }
View Full Code Here

    public void parseComposedXml() throws ParserConfigurationException, SAXException, IOException {
        InputStream inPlan = getClass().getClassLoader().getResourceAsStream("plans/plan_with_pap.xml");
       
        SAXParser parser = validatingParserFactory.getValidatingParser();
        parser.setProperty(ValidatingParserFactory.JAXP_SCHEMA_SOURCE, PlanXMLConstants.PLATO_SCHEMA_URI);
        SchemaResolver schemaResolver = new SchemaResolver()
            .addSchemaLocation(PlanXMLConstants.PLATO_SCHEMA_URI, PlanXMLConstants.PLATO_SCHEMA_LOCATION)
            .addSchemaLocation(PlanXMLConstants.PAP_SCHEMA_URI, PlanXMLConstants.PAP_SCHEMA_LOCATION)
            .addSchemaLocation(PlanXMLConstants.TAVERNA_SCHEMA_URI, PlanXMLConstants.TAVERNA_SCHEMA_LOCATION);

        parser.parse(inPlan, new StrictDefaultHandler(schemaResolver));
View Full Code Here

    public void parseXmlWithAnyContent() throws ParserConfigurationException, SAXException, IOException {
        InputStream inPlan = getClass().getClassLoader().getResourceAsStream("simple/anyExtendedContent.xml");

        SAXParser parser = validatingParserFactory.getValidatingParser();
        parser.setProperty(ValidatingParserFactory.JAXP_SCHEMA_SOURCE, "http://simple.org/any/any.xsd");
        SchemaResolver schemaResolver = new SchemaResolver()
        .addSchemaLocation("http://simple.org/any/any.xsd", "simple/any.xsd")
        .addSchemaLocation("http://simple.org/bla/bla.xsd", "simple/bla.xsd");
       
       
        parser.parse(
View Full Code Here

            parser.setProperty(ValidatingParserFactory.JAXP_SCHEMA_SOURCE, ProjectImporter.TAVERNA_SCHEMA_URI);

            SAXReader reader = new SAXReader(parser.getXMLReader());
            reader.setValidation(true);

            SchemaResolver schemaResolver = new SchemaResolver();
            schemaResolver.addSchemaLocation(ProjectImporter.TAVERNA_SCHEMA_URI, SCHEMA_LOCATION
                + ProjectImporter.TAVERNA_SCHEMA);
            reader.setEntityResolver(schemaResolver);

            doc = reader.read(t2flow);
        } catch (DocumentException e) {
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.xml.SchemaResolver

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.