Project

Profile

Help

Revision 29b619a3

Added by Michael Kay about 14 years ago

Fix bug 1818201 (-r flag on Query command line)

View differences:

latest8.9/bj/net/sf/saxon/Query.java
170 170
                            badUsage(name, "No ModuleURIResolver class");
171 171
                        }
172 172
                        String r = args[i++];
173
                        config.setModuleURIResolver(r);
173
                        Object mr = config.getInstance(r, null);
174
                        if (!(mr instanceof ModuleURIResolver)) {
175
                            badUsage(name, r + " is not a ModuleURIResolver");
176
                        }
177
                        staticEnv.setModuleURIResolver((ModuleURIResolver)mr);
174 178
                    } else if (args[i].equals("-noext")) {
175 179
                        i++;
176 180
                        config.setAllowExternalFunctions(false);
......
364 368
                    String q = queryFileName.substring(1, queryFileName.length() - 1);
365 369
                    exp = staticEnv.compileQuery(q);
366 370
                } else if (useURLs || queryFileName.startsWith("http:") || queryFileName.startsWith("file:")) {
367
                    ModuleURIResolver resolver = config.getModuleURIResolver();
371
                    ModuleURIResolver resolver = staticEnv.getModuleURIResolver();
368 372
                    String[] locations = {queryFileName};
369 373
                    Source[] sources = resolver.resolve(null, null, locations);
370 374
                    if (sources.length != 1 || !(sources[0] instanceof StreamSource)) {

Also available in: Unified diff