Search in sources :

Example 11 with ISchematronResource

use of com.helger.schematron.ISchematronResource in project ph-schematron by phax.

the class SVRLMarshallerTest method testCreate.

@Test
public void testCreate() throws Exception {
    final ISchematronResource aSV = SchematronResourceSCH.fromClassPath(VALID_SCHEMATRON);
    assertNotNull("Failed to parse Schematron", aSV);
    final Document aDoc = aSV.applySchematronValidation(new ClassPathResource(VALID_XMLINSTANCE));
    assertNotNull("Failed to parse demo XML", aDoc);
    final SchematronOutputType aSO = new SVRLMarshaller().read(aDoc);
    assertNotNull("Failed to parse Schematron output", aSO);
}
Also used : SchematronOutputType(org.oclc.purl.dsdl.svrl.SchematronOutputType) ISchematronResource(com.helger.schematron.ISchematronResource) Document(org.w3c.dom.Document) ClassPathResource(com.helger.commons.io.resource.ClassPathResource) Test(org.junit.Test)

Aggregations

ISchematronResource (com.helger.schematron.ISchematronResource)11 SchematronOutputType (org.oclc.purl.dsdl.svrl.SchematronOutputType)7 SVRLMarshaller (com.helger.schematron.svrl.SVRLMarshaller)6 FileSystemResource (com.helger.commons.io.resource.FileSystemResource)5 ClassPathResource (com.helger.commons.io.resource.ClassPathResource)4 SchematronResourcePure (com.helger.schematron.pure.SchematronResourcePure)4 SchematronResourceSCH (com.helger.schematron.xslt.SchematronResourceSCH)4 Nullable (javax.annotation.Nullable)4 Test (org.junit.Test)4 ICommonsList (com.helger.commons.collection.impl.ICommonsList)3 IError (com.helger.commons.error.IError)3 EErrorLevel (com.helger.commons.error.level.EErrorLevel)3 IErrorList (com.helger.commons.error.list.IErrorList)3 StringHelper (com.helger.commons.string.StringHelper)3 ESchematronMode (com.helger.schematron.ESchematronMode)3 CollectingPSErrorHandler (com.helger.schematron.pure.errorhandler.CollectingPSErrorHandler)3 SVRLHelper (com.helger.schematron.svrl.SVRLHelper)3 SchematronResourceXSLT (com.helger.schematron.xslt.SchematronResourceXSLT)3 CollectingTransformErrorListener (com.helger.xml.transform.CollectingTransformErrorListener)3 TransformSourceFactory (com.helger.xml.transform.TransformSourceFactory)3