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
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,6 @@ public class ValidationResourceResolver implements LSResourceResolver { ...@@ -31,7 +31,6 @@ public class ValidationResourceResolver implements LSResourceResolver {
private final Set<ValidationSchema> namespaceSchemaMap ; private final Set<ValidationSchema> namespaceSchemaMap ;
private final ValidationResultHandle resultHandle; private final ValidationResultHandle resultHandle;
public ValidationResourceResolver(Set<ValidationSchema> namespaceSchemaMap, ValidationResultHandle resultHandle) { public ValidationResourceResolver(Set<ValidationSchema> namespaceSchemaMap, ValidationResultHandle resultHandle) {
this.namespaceSchemaMap = namespaceSchemaMap; this.namespaceSchemaMap = namespaceSchemaMap;
this.resultHandle = resultHandle; this.resultHandle = resultHandle;
...@@ -71,17 +70,21 @@ public class ValidationResourceResolver implements LSResourceResolver { ...@@ -71,17 +70,21 @@ public class ValidationResourceResolver implements LSResourceResolver {
} }
private Path createCombinedSchemaFile (String systemId, String baseURIString ) { private Path createCombinedSchemaFile (String systemId, String baseURIString ) {
assert baseURIString != null;
assert systemId != null;
Path basenameSystemID = Paths.get(systemId).getFileName(); Path basenameSystemID = Paths.get(systemId).getFileName();
Path dirnameSchema = null; Path dirnameSchema;
try { 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) { } catch (URISyntaxException e) {
throw new RuntimeException(e); // should not occure throw new RuntimeException(e); // should not occure
} }
//combine together /*
Path combinedSchema = dirnameSchema.resolve(basenameSystemID); System.out.println("##### dirname: "+ dirnameSchema.toString());
//System.out.println( "COMBINED: " + combinedSchema.toString()); System.out.println("##### basename: "+ basenameSystemID.toString());
return combinedSchema; */
return dirnameSchema.resolve(basenameSystemID);
} }
@Override @Override
public LSInput resolveResource(String type, String nameSpace, String publicId, String systemId, String baseURIString) { public LSInput resolveResource(String type, String nameSpace, String publicId, String systemId, String baseURIString) {
...@@ -111,21 +114,19 @@ public class ValidationResourceResolver implements LSResourceResolver { ...@@ -111,21 +114,19 @@ public class ValidationResourceResolver implements LSResourceResolver {
b) MATHML3 uses includes of XSD to same namespaces b) MATHML3 uses includes of XSD to same namespaces
*/ */
URI schemaURI = validationSchemaOptional.get().schemaURI; URI schemaURI = validationSchemaOptional.get().schemaURI;
/*
System.out.println("### BASEURI: " + baseURIString + " -> " + checkUriStringIsLocal( baseURIString )); System.out.println("### BASEURI: " + baseURIString + " -> " + checkUriStringIsLocal( baseURIString ));
System.out.println("### SchemaURI: " + schemaURI + " -> " + checkUriIsLocal( schemaURI) ); System.out.println("### SchemaURI: " + schemaURI + " -> " + checkUriIsLocal( schemaURI) );
*/
if (checkUriStringIsLocal(baseURIString)) { if (checkUriStringIsLocal(baseURIString)) {
if (checkUriIsLocal(schemaURI)) { if (checkUriIsLocal(schemaURI)) {
Path basenameSystemID = Paths.get(systemId).getFileName(); assert systemId != null;
Path dirnameSchema = null; assert baseURIString != null;
try {
dirnameSchema = Paths.get(new URI(baseURIString).getPath()).getParent().toAbsolutePath();
} catch (URISyntaxException e) {
throw new RuntimeException(e); // should not occure
}
//combine together
Path combinedSchema = createCombinedSchemaFile(systemId, baseURIString); Path combinedSchema = createCombinedSchemaFile(systemId, baseURIString);
String combinedSchemaStr = combinedSchema.toString(); String combinedSchemaStr = combinedSchema.toString();
/*
System.out.println("### COMBINED: "+ combinedSchemaStr);
*/
File combinedSchemaFile = new File( combinedSchemaStr ); File combinedSchemaFile = new File( combinedSchemaStr );
if (combinedSchemaFile.isFile()) { if (combinedSchemaFile.isFile()) {
resultHandle.info("RESOURCE_RESOLVER: ignoring catalog, using a combined mapping to " + schemaURI + " !"); 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