use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class Issue126Test method _validateAndProduceSVRL.
private static void _validateAndProduceSVRL(@Nonnull final File aSchematron, @Nonnull final File aXML) throws Exception {
final SchematronResourcePure aSCH = SchematronResourcePure.fromFile(aSchematron);
aSCH.setCustomValidationHandler(new LoggingPSValidationHandler());
// Perform validation
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXML));
assertNotNull(aSVRL);
final String sSVRL = new SVRLMarshaller().getAsString(aSVRL);
assertNotNull(sSVRL);
if (true)
LOGGER.info("SVRL:\n" + sSVRL);
assertEquals(1, SVRLHelper.getAllFailedAssertionsAndSuccessfulReports(aSVRL).size());
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class IssueDita1Test method validateAndProduceSVRL.
public static void validateAndProduceSVRL(final File aSchematronFile, final File aXmlFile) throws Exception {
final AbstractSchematronResource aSCH = SchematronResourcePure.fromFile(aSchematronFile);
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXmlFile));
assertNotNull(aSVRL);
if (true)
System.out.println(new SVRLMarshaller().getAsString(aSVRL));
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class IssueGC5Test method validateAndProduceSVRL.
public static void validateAndProduceSVRL(final File schematron, final File xml) throws Exception {
final IReadableResource aSchematron = new FileSystemResource(schematron.getAbsoluteFile());
final IReadableResource anXMLSource = new FileSystemResource(xml.getAbsoluteFile());
final SchematronResourcePure pure = new SchematronResourcePure(aSchematron);
// final FileOutputStream fos = new FileOutputStream (result);
// final Result res = new StreamResult (fos);
// res.setSystemId(result.getAbsolutePath());
final SchematronOutputType aSO = pure.applySchematronValidationToSVRL(anXMLSource);
final ICommonsList<SVRLFailedAssert> aFailedAsserts = SVRLHelper.getAllFailedAssertions(aSO);
LOGGER.info(aFailedAsserts.toString());
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class IssueGC7Test method validateAndProduceSVRL.
public static void validateAndProduceSVRL(final File schematron, final File xml) throws Exception {
final IReadableResource aSchematron = new FileSystemResource(schematron.getAbsoluteFile());
final IReadableResource anXMLSource = new FileSystemResource(xml.getAbsoluteFile());
final AbstractSchematronResource pure = new SchematronResourcePure(aSchematron);
final SchematronOutputType aSVRL = pure.applySchematronValidationToSVRL(anXMLSource);
assertNotNull(aSVRL);
if (false)
System.out.println(new SVRLMarshaller().getAsString(aSVRL));
}
use of com.helger.schematron.svrl.jaxb.SchematronOutputType in project ph-schematron by phax.
the class IssueGC9Test method validateAndProduceSVRL.
public static void validateAndProduceSVRL(final File schematron, final File xml) throws Exception {
final IReadableResource aSchematron = new FileSystemResource(schematron.getAbsoluteFile());
final IReadableResource anXMLSource = new FileSystemResource(xml.getAbsoluteFile());
final AbstractSchematronResource pure = new SchematronResourcePure(aSchematron);
final SchematronOutputType aSVRL = pure.applySchematronValidationToSVRL(anXMLSource);
assertNotNull(aSVRL);
if (false)
System.out.println(new SVRLMarshaller().getAsString(aSVRL));
}
Aggregations