use of com.helger.commons.io.resource.IReadableResource in project ph-schematron by phax.
the class Issue25Test method testIssue25Valid.
@Test
public void testIssue25Valid() throws Exception {
final IReadableResource aSCH = new ClassPathResource("test-sch/xfront/example05/check-classifications.sch");
final IReadableResource aXML = new ClassPathResource("test-sch/xfront/example05/valid-document.xml");
final SchematronOutputType aSOT = SchematronHelper.applySchematron(new SchematronResourcePure(aSCH), aXML);
assertNotNull(aSOT);
assertTrue(SVRLHelper.getAllFailedAssertions(aSOT).isEmpty());
}
use of com.helger.commons.io.resource.IReadableResource in project ph-schematron by phax.
the class Issue6Test method validateAndProduceSVRL.
@SuppressFBWarnings("BC_IMPOSSIBLE_INSTANCEOF")
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 aSCH = new SchematronResourceSCH(aSchematron);
if (aSCH instanceof SchematronResourcePure)
((SchematronResourcePure) aSCH).setErrorHandler(new LoggingPSErrorHandler());
else
System.out.println(XMLWriter.getNodeAsString(((SchematronResourceSCH) aSCH).getXSLTProvider().getXSLTDocument()));
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(anXMLSource);
assertNotNull(aSVRL);
if (false)
System.out.println(new SVRLMarshaller().getAsString(aSVRL));
}
use of com.helger.commons.io.resource.IReadableResource 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));
}
use of com.helger.commons.io.resource.IReadableResource in project ph-schematron by phax.
the class IssueXsltKeyTest 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 SchematronResourceSCH(aSchematron);
final SchematronOutputType aSVRL = pure.applySchematronValidationToSVRL(anXMLSource);
assertNotNull(aSVRL);
if (false)
System.out.println(new SVRLMarshaller().getAsString(aSVRL));
}
use of com.helger.commons.io.resource.IReadableResource 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 svrl = pure.applySchematronValidationToSVRL
// (anXMLSource);
final SchematronOutputType aSO = SchematronHelper.applySchematron(pure, anXMLSource);
final List<SVRLFailedAssert> aFailedAsserts = SVRLHelper.getAllFailedAssertions(aSO);
System.out.println(aFailedAsserts);
}
Aggregations