mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-26 01:05:38 +00:00
make report optional
This commit is contained in:
parent
9f3ded6e5b
commit
55ec1dc560
4 changed files with 73 additions and 30 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package de.kosit.validationtool.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
|
|
@ -265,4 +266,18 @@ public class ContentRepository {
|
|||
public Transformation createSchematronTransformation(final ValidateWithSchematron validateWithSchematron) {
|
||||
return createTransformation(validateWithSchematron.getResource());
|
||||
}
|
||||
|
||||
public Transformation createIdentityTransformation() {
|
||||
final URL url = ContentRepository.class.getClassLoader().getResource("transform/identity.xsl");
|
||||
try ( final InputStream input = url.openStream() ) {
|
||||
final XsltCompiler xsltCompiler = getProcessor().newXsltCompiler();
|
||||
final XsltExecutable executable = xsltCompiler.compile(new StreamSource(input));
|
||||
final ResourceType resource = new ResourceType();
|
||||
resource.setName("identity");
|
||||
resource.setLocation(url.toString());
|
||||
return new Transformation(executable, resource);
|
||||
} catch (final IOException | SaxonApiException e) {
|
||||
throw new IllegalStateException("Error creating identity transformation", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue