mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
more tests
This commit is contained in:
parent
7abc072911
commit
1a001a1af4
6 changed files with 115 additions and 4 deletions
|
|
@ -57,7 +57,7 @@ public class SchemaBuilder implements Builder<Pair<ValidateWithXmlSchema, Schema
|
|||
final ValidateWithXmlSchema o = new ValidateWithXmlSchema();
|
||||
final ResourceType r = new ResourceType();
|
||||
r.setName(isNotEmpty(this.name) ? this.name : DEFAULT_NAME);
|
||||
r.setLocation(this.schemaLocation.toASCIIString());
|
||||
r.setLocation(this.schemaLocation != null ? this.schemaLocation.toASCIIString() : "manuelly configured");
|
||||
o.getResource().add(r);
|
||||
return o;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,14 @@ public class RelativeUriResolver implements URIResolver {
|
|||
}
|
||||
|
||||
private boolean isUnderBaseUri(final URI resolved) {
|
||||
final String base = this.baseUri.toASCIIString().replaceAll("file:/+", "");
|
||||
return isUnderBaseUri(resolved, this.baseUri);
|
||||
}
|
||||
|
||||
private static boolean isUnderBaseUri(final URI resolved, final URI baseUri) {
|
||||
if (resolved == null || baseUri == null) {
|
||||
return false;
|
||||
}
|
||||
final String base = baseUri.toASCIIString().replaceAll("file:/+", "");
|
||||
final String r = resolved.toASCIIString().replaceAll("file:/+", "");
|
||||
return r.startsWith(base);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue