Package org.openehealth.ipf.commons.xml
Class SchematronTransmogrifier<T>
java.lang.Object
org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor<Templates>
org.openehealth.ipf.commons.xml.XsltTransmogrifier<T>
org.openehealth.ipf.commons.xml.SchematronTransmogrifier<T>
- All Implemented Interfaces:
Transmogrifier<Source,
T>
Converts a XML document into a Schematron validation report by applying
Schematron rules. The rules to be used are passed in with the
XsltTransmogrifier.zap(Source, Object...)
call, however, the resulting Xslt Template
object is cached for subsequent transformations using this stylesheet.
The following standard Schematron parameters can be passed in as Map parameter:
- phase : NMTOKEN | "#ALL" (default) Select the phase for validation
- allow-foreign : "true" | "false" (default) Pass non-Schematron elements and rich markup to the generated stylesheet
- diagnose : "true" (default) | "false" Add the diagnostics to the assertion test in reports
- property : "true" (default) | "false" Experimental: Add properties to the assertion test in reports
- generate-paths : "true" (default) | "false" Generate the @location attribute with XPaths
- sch.exslt.imports : semi-colon delimited string of filenames for some EXSLT implementations
- optimize : "visit-no-attributes" Use only when the schema has no attributes as the context nodes
- generate-fired-rule: "true" (default) | "false" Generate fired-rule elements
- Author:
- Christian Ohr
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor
AbstractCachingXmlProcessor.Loader<S>
-
Field Summary
Fields inherited from class org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor
RESOURCE_LOCATION
-
Constructor Summary
ConstructorDescriptionSchematronTransmogrifier
(Class<T> outputFormat) SchematronTransmogrifier
(XsltTransmogrifier<String> t, Class<T> outputFormat) SchematronTransmogrifier
(XsltTransmogrifier<String> t, Class<T> outputFormat, Map<String, Object> staticParams) -
Method Summary
Modifier and TypeMethodDescriptionprotected Templates
createResource
(Object... params) Creates a ready-to-use resource (e.g.protected String
resourceCacheKey
(Object... params) Extracts (constructs) resource cache key validator/transmogrifier parameters.Methods inherited from class org.openehealth.ipf.commons.xml.XsltTransmogrifier
getCache, getFactory, getStaticParams, setStaticParams, setXsltParameters, zap
Methods inherited from class org.openehealth.ipf.commons.xml.AbstractCachingXmlProcessor
resource, resourceContent, resourceLocation, resourceParameters
-
Constructor Details
-
SchematronTransmogrifier
public SchematronTransmogrifier() -
SchematronTransmogrifier
-
SchematronTransmogrifier
-
SchematronTransmogrifier
-
SchematronTransmogrifier
-
-
Method Details
-
resourceCacheKey
Description copied from class:AbstractCachingXmlProcessor
Extracts (constructs) resource cache key validator/transmogrifier parameters. Per default, the key equals to the resource location.- Overrides:
resourceCacheKey
in classAbstractCachingXmlProcessor<Templates>
- Parameters:
params
- validator/transmogrifier parameters.- Returns:
- cache key as a String.
-
createResource
Description copied from class:AbstractCachingXmlProcessor
Creates a ready-to-use resource (e.g. an XML Schema instance) for the given key. Insertion into the cache will happen externally, this method's purpose is only to instantiate the resource to be cached. This method does not need to be re-entrant, but its result MUST be thread-safe.- Overrides:
createResource
in classXsltTransmogrifier<T>
- Parameters:
params
- validator/transmogrifier parameters.- Returns:
- resource of the configured type.
-