From db9818f07906162458b9e0d4d55d44d75b0340b5 Mon Sep 17 00:00:00 2001
From: Andreas Romeyke <andreas.romeyke@slub-dresden.de>
Date: Mon, 24 Jul 2023 09:21:11 +0200
Subject: [PATCH] - bugfix, combined now follows URI pattern
 file://localhost/$PATH

---
 .../plugin/ValidationResourceResolver.java    | 23 +++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/java/org/slub/rosetta/dps/repository/plugin/ValidationResourceResolver.java b/java/org/slub/rosetta/dps/repository/plugin/ValidationResourceResolver.java
index 165e343..826c23d 100644
--- a/java/org/slub/rosetta/dps/repository/plugin/ValidationResourceResolver.java
+++ b/java/org/slub/rosetta/dps/repository/plugin/ValidationResourceResolver.java
@@ -126,23 +126,28 @@ 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) );
-        */
+
+        resultHandle.debug("### BASEURI:   " + baseURIString + " -> " + checkUriStringIsLocal( baseURIString ));
+        resultHandle.debug("### SchemaURI: " + schemaURI + " -> " + checkUriIsLocal( schemaURI) );
+
         if (checkUriStringIsLocal(baseURIString)) {
             if (checkUriIsLocal(schemaURI)) {
                 assert systemId != null;
                 assert baseURIString != null;
                 Path combinedSchema = createCombinedSchemaFile(systemId, baseURIString);
                 String combinedSchemaStr = combinedSchema.toString();
-                /*
-                System.out.println("### COMBINED: "+ combinedSchemaStr);
-                 */
+                String combinedSchemaURIStr = "file://localhost".concat(combinedSchemaStr);
+
+                resultHandle.debug("### COMBINED:  "+ combinedSchemaURIStr);
+
                 File combinedSchemaFile = new File( combinedSchemaStr );
                 if (combinedSchemaFile.isFile()) {
-                    resultHandle.info("RESOURCE_RESOLVER: ignoring catalog, using a combined mapping to "+ combinedSchemaStr + " instead of " + schemaURI + "!");
-                    schemaURI = combinedSchema.toUri();
+                    resultHandle.info("RESOURCE_RESOLVER: ignoring catalog, using a combined mapping to "+ combinedSchemaURIStr + " instead of " + schemaURI + "!");
+                    try {
+                        schemaURI = new URI(combinedSchemaURIStr);
+                    } catch (URISyntaxException e) {
+                        resultHandle.error( e.getMessage() );
+                    }
                 }
             }
         }
-- 
GitLab