Search in sources :

Example 6 with LoggingPSErrorHandler

use of com.helger.schematron.pure.errorhandler.LoggingPSErrorHandler in project ph-schematron by phax.

the class Issue4Test method testReadFromUNCWithInclude.

@Test
public void testReadFromUNCWithInclude() throws Exception {
    final File aSchematronFile = new File("\\\\PC61826\\share\\example-8-5.sch");
    if (aSchematronFile.exists()) {
        final SchematronResourcePure aResPure = SchematronResourcePure.fromFile(aSchematronFile);
        aResPure.setErrorHandler(new LoggingPSErrorHandler());
        aResPure.validateCompletely();
        assertTrue(aResPure.isValidSchematron());
    } else
        s_aLogger.info("Test ignored because file does not exist");
}
Also used : LoggingPSErrorHandler(com.helger.schematron.pure.errorhandler.LoggingPSErrorHandler) File(java.io.File) SchematronResourcePure(com.helger.schematron.pure.SchematronResourcePure) Test(org.junit.Test)

Example 7 with LoggingPSErrorHandler

use of com.helger.schematron.pure.errorhandler.LoggingPSErrorHandler in project ph-schematron by phax.

the class Issue64Test method validateAndProduceSVRL.

public static void validateAndProduceSVRL(@Nonnull final File aSchematron, final File aXML) throws Exception {
    final SchematronResourcePure aSCH = SchematronResourcePure.fromFile(aSchematron);
    aSCH.setErrorHandler(new LoggingPSErrorHandler());
    // Perform validation
    final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXML));
    assertNotNull(aSVRL);
}
Also used : SchematronOutputType(org.oclc.purl.dsdl.svrl.SchematronOutputType) LoggingPSErrorHandler(com.helger.schematron.pure.errorhandler.LoggingPSErrorHandler) FileSystemResource(com.helger.commons.io.resource.FileSystemResource) SchematronResourcePure(com.helger.schematron.pure.SchematronResourcePure)

Aggregations

LoggingPSErrorHandler (com.helger.schematron.pure.errorhandler.LoggingPSErrorHandler)7 SchematronResourcePure (com.helger.schematron.pure.SchematronResourcePure)6 SchematronOutputType (org.oclc.purl.dsdl.svrl.SchematronOutputType)6 FileSystemResource (com.helger.commons.io.resource.FileSystemResource)5 Test (org.junit.Test)4 SVRLMarshaller (com.helger.schematron.svrl.SVRLMarshaller)2 IReadableResource (com.helger.commons.io.resource.IReadableResource)1 AbstractSchematronResource (com.helger.schematron.AbstractSchematronResource)1 CollectingPSErrorHandler (com.helger.schematron.pure.errorhandler.CollectingPSErrorHandler)1 XQueryAsXPathFunctionConverter (com.helger.schematron.xpath.XQueryAsXPathFunctionConverter)1 SchematronResourceSCH (com.helger.schematron.xslt.SchematronResourceSCH)1 MapBasedXPathFunctionResolver (com.helger.xml.xpath.MapBasedXPathFunctionResolver)1 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 File (java.io.File)1 Document (org.w3c.dom.Document)1