Skip to content
Snippets Groups Projects
Commit 9b4d11dc authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- disabled debugging output

- minor changes
parent 1bd16d73
Branches
Tags
No related merge requests found
......@@ -31,7 +31,6 @@ public class ValidationResourceResolver implements LSResourceResolver {
private final Set<ValidationSchema> namespaceSchemaMap ;
private final ValidationResultHandle resultHandle;
public ValidationResourceResolver(Set<ValidationSchema> namespaceSchemaMap, ValidationResultHandle resultHandle) {
this.namespaceSchemaMap = namespaceSchemaMap;
this.resultHandle = resultHandle;
......@@ -71,17 +70,21 @@ public class ValidationResourceResolver implements LSResourceResolver {
}
private Path createCombinedSchemaFile (String systemId, String baseURIString ) {
assert baseURIString != null;
assert systemId != null;
Path basenameSystemID = Paths.get(systemId).getFileName();
Path dirnameSchema = null;
Path dirnameSchema;
try {
dirnameSchema = Paths.get(new URI(baseURIString).getPath()).getParent().toAbsolutePath();
URI baseURI = new URI(baseURIString);
dirnameSchema = Paths.get( baseURI.getPath() ).getParent().toAbsolutePath();
} catch (URISyntaxException e) {
throw new RuntimeException(e); // should not occure
}
//combine together
Path combinedSchema = dirnameSchema.resolve(basenameSystemID);
//System.out.println( "COMBINED: " + combinedSchema.toString());
return combinedSchema;
/*
System.out.println("##### dirname: "+ dirnameSchema.toString());
System.out.println("##### basename: "+ basenameSystemID.toString());
*/
return dirnameSchema.resolve(basenameSystemID);
}
@Override
public LSInput resolveResource(String type, String nameSpace, String publicId, String systemId, String baseURIString) {
......@@ -111,21 +114,19 @@ public class ValidationResourceResolver implements LSResourceResolver {
b) MATHML3 uses includes of XSD to same namespaces
*/
URI schemaURI = validationSchemaOptional.get().schemaURI;
/*
System.out.println("### BASEURI: " + baseURIString + " -> " + checkUriStringIsLocal( baseURIString ));
System.out.println("### SchemaURI: " + schemaURI + " -> " + checkUriIsLocal( schemaURI) );
*/
if (checkUriStringIsLocal(baseURIString)) {
if (checkUriIsLocal(schemaURI)) {
Path basenameSystemID = Paths.get(systemId).getFileName();
Path dirnameSchema = null;
try {
dirnameSchema = Paths.get(new URI(baseURIString).getPath()).getParent().toAbsolutePath();
} catch (URISyntaxException e) {
throw new RuntimeException(e); // should not occure
}
//combine together
assert systemId != null;
assert baseURIString != null;
Path combinedSchema = createCombinedSchemaFile(systemId, baseURIString);
String combinedSchemaStr = combinedSchema.toString();
/*
System.out.println("### COMBINED: "+ combinedSchemaStr);
*/
File combinedSchemaFile = new File( combinedSchemaStr );
if (combinedSchemaFile.isFile()) {
resultHandle.info("RESOURCE_RESOLVER: ignoring catalog, using a combined mapping to " + schemaURI + " !");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment