Example #1
0
        public DataleveranseValidatorTest()
        {
            //var findDirectoryInTree = TestSetup.FindDirectoryInTree(@"schema\cache\");
            var xsd     = FileLocator.FindFileInTree(@"schema\cache\ogc_schema_updates.rss");
            var xsdPath = Path.GetDirectoryName(xsd);

            GmlXmlResolver gmlXmlResolver = DataleveranseXmlGreier.CreateGmlXmlResolver(xsdPath);

            dataDeliveryImportValidator    = CreateValidator(gmlXmlResolver, @"schema\NiNCoreDataLeveranse.xsd");
            dataDeliveryExportValidator    = CreateValidator(gmlXmlResolver, @"schema\NiNCoreDataEksport.xsd");
            dataDeliveryMapImportValidator = CreateValidator(gmlXmlResolver, @"schema\NiNCoreGridLeveranse.xsd");
        }
Example #2
0
        public static GmlXmlResolver CreateGmlXmlResolver(string xsdCachePath)
        {
            Log.i("XSD", "Reading schemas from " + xsdCachePath);
            var resolver = new GmlXmlResolver(new Uri("file:///" + xsdCachePath + "/"));

            resolver.UriMap.Add("http://shapechange.net/resources/schema/ShapeChangeAppinfo.xsd", "ShapeChangeAppinfo.xsd");
            resolver.UriMap.Add("http://www.w3.org/1999/xlink.xsd", "1999/xlink.xsd");
            resolver.UriMap.Add("http://www.w3.org/2001/xml.xsd", "2001/xml.xsd");
            resolver.UriMap.Add("http://schemas.opengis.net/gml/3.2.1/gml.xsd", "gml/3.2.1/gml.xsd");
            resolver.UriMap.Add("http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd", "iso/19139/20070417/gmd/gmd.xsd");
            resolver.UriMap.Add("http://schemas.opengis.net/iso/19139/20070417/gco/gco.xsd", "iso/19139/20070417/gco/gco.xsd");
            resolver.UriMap.Add("http://schemas.opengis.net/iso/19139/20070417/gss/gss.xsd", "iso/19139/20070417/gss/gss.xsd");
            resolver.UriMap.Add("http://schemas.opengis.net/iso/19139/20070417/gts/gts.xsd", "iso/19139/20070417/gts/gts.xsd");
            resolver.UriMap.Add("http://schemas.opengis.net/iso/19139/20070417/gsr/gsr.xsd", "iso/19139/20070417/gsr/gsr.xsd");
            return(resolver);
        }