eu.peppol.validation.commons.schematron
Interface ISchematronResource

All Superinterfaces:
com.phloc.commons.id.IHasID<String>
All Known Implementing Classes:
AbstractSchematronResource, AbstractSchematronXSLTResource, SchematronResourceSCH, SchematronResourceXSLT

public interface ISchematronResource
extends com.phloc.commons.id.IHasID<String>

Base interface for a Schematron resource. The implementation can e.g. be a SCH file that needs preprocessing to XSLT or an already precompiled XSLT file.

Author:
PEPPOL.AT, BRZ, Philip Helger

Method Summary
 Document applySchematronValidation(com.phloc.commons.io.IReadableResource aXMLResource)
          Apply the schematron validation on the passed XML resource and return an SVRL XML document.
 Document applySchematronValidation(Source aXMLSource)
          Apply the schematron validation on the passed XML source and return an SVRL XML document.
 com.phloc.commons.io.IReadableResource getResource()
           
 boolean isValidSchematron()
           
 
Methods inherited from interface com.phloc.commons.id.IHasID
getID
 

Method Detail

getResource

@Nonnull
com.phloc.commons.io.IReadableResource getResource()
Returns:
The non-null resource from which to read the Schematron rules.

isValidSchematron

boolean isValidSchematron()
Returns:
true if this Schematron can be used to validate XML instances. If not, the Schematron is invalid and the log files must be investigated.

applySchematronValidation

@Nullable
Document applySchematronValidation(@Nonnull
                                            com.phloc.commons.io.IReadableResource aXMLResource)
                                   throws Exception
Apply the schematron validation on the passed XML resource and return an SVRL XML document.

Parameters:
aXMLResource - The XML resource to validate via Schematron. May not be null.
Returns:
null if the passed resource does not exist or the non- null SVRL document otherwise.
Throws:
Exception - In case the transformation somehow goes wrong.
See Also:
on how to convert the document into a domain object

applySchematronValidation

@Nullable
Document applySchematronValidation(@Nonnull
                                            Source aXMLSource)
                                   throws Exception
Apply the schematron validation on the passed XML source and return an SVRL XML document.

Parameters:
aXMLSource - The XML source to validate via Schematron. May not be null.
Returns:
The SVRL XML document containing the result. May be null when interpreting the Schematron failed.
Throws:
Exception - In case the transformation somehow goes wrong.
See Also:
on how to convert the document into a domain object


Copyright © 2011 PEPPOL project. All Rights Reserved.