Package org.geotools.xml.resolver

Examples of org.geotools.xml.resolver.SchemaResolver


    private static NamespaceSupport gml32NS;

    @BeforeClass
    public static void oneTimeSetUp() throws IOException {
        SchemaResolver resolver = new SchemaResolver();
        String schemalocation = SchemaResolver
                .resolveClasspathLocation("http://schemas.geosciml.org/borehole/3.2/borehole.xsd");
        EmfAppSchemaReader schemaParser = EmfAppSchemaReader.newInstance();
        schemaParser.setResolver(resolver);
        schemaIndex = schemaParser.parse(BOREHOLE_NS, schemalocation);
View Full Code Here


    public void testCatalogSchemaResolution() throws Exception {
        URL catalogLocation = getClass().getResource(schemaBase + "mappedPolygons.oasis.xml");
        String namespace = "http://www.cgi-iugs.org/xml/GeoSciML/2";
        String schemaLocation = "http://schemas.opengis.net/GeoSciML/geosciml.xsd";
        Configuration config = new AppSchemaConfiguration(namespace, schemaLocation,
                new SchemaResolver(SchemaCatalog.build(catalogLocation)));
        String resolvedSchemaLocation = config.getXSD().getSchemaLocation();
        assertTrue(resolvedSchemaLocation.startsWith("file:/"));
        assertTrue(resolvedSchemaLocation.endsWith(schemaBase
                + "commonSchemas_new/GeoSciML/geosciml.xsd"));
    }
View Full Code Here

     */
    @Test
    public void findGml31Configuration() {
        AppSchemaConfiguration configuration = new AppSchemaConfiguration(
                "urn:cgi:xmlns:CGI:GeoSciML:2.0",
                "http://www.geosciml.org/geosciml/2.0/xsd/geosciml.xsd", new SchemaResolver());
        Configuration gmlConfiguration = EmfAppSchemaReader.findGmlConfiguration(configuration);
        Assert.assertNotNull(gmlConfiguration);
        Assert.assertEquals(new GMLConfiguration(), gmlConfiguration);
    }
View Full Code Here

    @Test
    public void findGml32Configuration() {
        AppSchemaConfiguration configuration = new AppSchemaConfiguration(
                "urn:cgi:xmlns:CGI:GeoSciML-Core:3.0.0",
                "https://www.seegrid.csiro.au/subversion/GeoSciML/branches/3.0.0_rc1_gml3.2/geosciml-core/3.0.0/xsd/geosciml-core.xsd",
                new SchemaResolver());
        Configuration gmlConfiguration = EmfAppSchemaReader.findGmlConfiguration(configuration);
        Assert.assertNotNull(gmlConfiguration);
        Assert.assertEquals(new org.geotools.gml3.v3_2.GMLConfiguration(), gmlConfiguration);
    }
View Full Code Here

    SchemaCatalog catalog = SchemaCatalog.build(getClass()
        .getResource("/test-data/mappedPolygons.oasis.xml"));
    AppSchemaConfiguration configuration = new AppSchemaConfiguration(
        "http://www.opengis.net/swe/2.0",
        "http://schemas.opengis.net/sweCommon/2.0/swe.xsd",
        new SchemaResolver(catalog));
    Configuration gmlConfiguration = EmfAppSchemaReader
        .findGmlConfiguration(configuration);
    // Null should be returned, not exception
    // Warning message should be in the log
    Assert.assertNull(gmlConfiguration);
View Full Code Here

   
    /**
     * Build the resolver (catalog plus cache) for this data access.
     */
    private SchemaResolver buildResolver() {
        return new SchemaResolver(buildCatalog(), buildCache());
    }
View Full Code Here

     * Construct an {@link AppSchemaValidator} that performs schema validation against schemas found
     * on the classpath using the convention described in
     * {@link SchemaResolver#getSimpleHttpResourcePath(java.net.URI)}.
     */
    private AppSchemaValidator() {
        this(new SchemaResolver());
    }
View Full Code Here

     *
     * @param catalog
     *            SchemaCatalog
     */
    private AppSchemaValidator(SchemaCatalog catalog) {
        this(new SchemaResolver(catalog));
    }
View Full Code Here

     * Set resolver based on catalog. Use this for testing only, because it does not support cached downloads.
     *
     * @param catalogLocation
     */
    public void setResolver(URL catalogLocation) {
        this.resolver = new SchemaResolver(SchemaCatalog.build(catalogLocation));
    }
View Full Code Here

        // download and cache schemas using app-schema-cache discovered from resource path
        SchemaCache cache = SchemaCache
                .buildAutomaticallyConfiguredUsingFileUrl(AppSchemaValidatorDemo.class
                        .getResource(RESOURCE));
        // no classpath resolution of schemas; cached downloads only
        SchemaResolver resolver = new SchemaResolver(null, false, cache);
        AppSchemaValidator validator = AppSchemaValidator.buildValidator(resolver);
        InputStream input = null;
        try {
            input = AppSchemaValidator.class.getResourceAsStream(RESOURCE);
            validator.parse(input);
View Full Code Here

TOP

Related Classes of org.geotools.xml.resolver.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.