### Question:
SchematronResourceSCHCache { @Nullable public static SchematronProviderXSLTFromSCH createSchematronXSLTProvider (@Nonnull final IReadableResource aSchematronResource, @Nonnull final SCHTransformerCustomizer aTransformerCustomizer) { if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Compiling Schematron instance " + aSchematronResource.toString ()); final SchematronProviderXSLTFromSCH aXSLTPreprocessor = new SchematronProviderXSLTFromSCH (aSchematronResource, aTransformerCustomizer); if (!aXSLTPreprocessor.isValidSchematron ()) { LOGGER.warn ("The Schematron resource '" + aSchematronResource.getResourceID () + "' is invalid!"); if (LOGGER.isDebugEnabled () && aXSLTPreprocessor.getXSLTDocument () != null) { LOGGER.debug (" Created XSLT document:\n" + XMLWriter.getNodeAsString (aXSLTPreprocessor.getXSLTDocument ())); } return null; } if (aXSLTPreprocessor.getXSLTDocument () == null) throw new IllegalStateException ("No XSLT document retrieved from Schematron resource '" + aSchematronResource.getResourceID () + "'!"); if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Finished compiling Schematron instance " + aSchematronResource.toString ()); return aXSLTPreprocessor; } private  SchematronResourceSCHCache(); @Nullable static SchematronProviderXSLTFromSCH createSchematronXSLTProvider(@Nonnull final IReadableResource aSchematronResource,
                                                                            @Nonnull final SCHTransformerCustomizer aTransformerCustomizer); @Nullable static SchematronProviderXSLTFromSCH getSchematronXSLTProvider(@Nonnull final IReadableResource aSchematronResource,
                                                                         @Nonnull final SCHTransformerCustomizer aTransformerCustomizer);  }### Answer:
@Test public void testXSLTPreprocessor () { for (final IReadableResource aRes : SchematronTestHelper.getAllValidSchematronFiles ()) if (!aRes.getPath ().endsWith ("/BIICORE-UBL-T01.sch") && !aRes.getPath ().endsWith ("/BIICORE-UBL-T10.sch") && !aRes.getPath ().endsWith ("/BIICORE-UBL-T14.sch") && !aRes.getPath ().endsWith ("/BIICORE-UBL-T15.sch") && !aRes.getPath ().endsWith ("/EUGEN-UBL-T14.sch") && !aRes.getPath ().endsWith ("/EUGEN-UBL-T15.sch") && !aRes.getPath ().endsWith ("/CellarBook.sch") && !aRes.getPath ().endsWith ("/pattern-example-with-includes.sch") && !aRes.getPath ().endsWith ("/pattern-example.sch") && !aRes.getPath ().endsWith ("/schematron-svrl.sch")) { if (true) LOGGER.info (aRes.toString ()); final CollectingTransformErrorListener aCEH = new CollectingTransformErrorListener (); final ISchematronXSLTBasedProvider aPreprocessor = SchematronResourceSCHCache.createSchematronXSLTProvider (aRes, new SCHTransformerCustomizer ().setErrorListener (aCEH) .setLanguageCode ("de")); assertNotNull ("Failed to parse: " + aRes.toString (), aPreprocessor); assertTrue (aRes.getPath (), aPreprocessor.isValidSchematron ()); assertNotNull (aPreprocessor.getXSLTDocument ()); final IErrorList aErrorGroup = aCEH.getErrorList (); if (aErrorGroup.isNotEmpty ()) { for (final IError aError : aErrorGroup) if (aError.isError ()) LOGGER.info ("!!" + aError.getAsString (Locale.US)); LOGGER.info ("!!" + XMLWriter.getNodeAsString (aPreprocessor.getXSLTDocument ())); } } }