use of com.helger.schematron.xslt.SchematronResourceSCH 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.schematron.xslt.SchematronResourceSCH in project ph-schematron by phax.
the class Issue8Test method validateAndProduceSVRL.
public static void validateAndProduceSVRL(@Nonnull final File aSchematron, final File aXML) throws Exception {
final SchematronResourceSCH aSCH = SchematronResourceSCH.fromFile(aSchematron);
// Assign custom parameters
aSCH.parameters().put("xyz", "mobile");
aSCH.parameters().put("expected", "");
if (false)
System.out.println(XMLWriter.getNodeAsString(aSCH.getXSLTProvider().getXSLTDocument()));
// Perform validation
final SchematronOutputType aSVRL = aSCH.applySchematronValidationToSVRL(new FileSystemResource(aXML));
assertNotNull(aSVRL);
if (false)
System.out.println(new SVRLMarshaller().getAsString(aSVRL));
}
Aggregations