Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xml_plugin4rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
xml_plugin4rosetta
Commits
9b4d11dc
Commit
9b4d11dc
authored
1 year ago
by
Andreas Romeyke
Browse files
Options
Downloads
Patches
Plain Diff
- disabled debugging output
- minor changes
parent
1bd16d73
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/org/slub/rosetta/dps/repository/plugin/ValidationResourceResolver.java
+17
-16
17 additions, 16 deletions
...tta/dps/repository/plugin/ValidationResourceResolver.java
with
17 additions
and
16 deletions
java/org/slub/rosetta/dps/repository/plugin/ValidationResourceResolver.java
+
17
−
16
View file @
9b4d11dc
...
...
@@ -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
+
" !"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment