public class InvalidityReportGenerator extends StandardInvalidityHandler
InvalidityReportGenerator extends the standard error handler for errors found during validation
of an instance document against a schema, used if user specifies -report option on validate. Its effect is to output
the validation errors found into the filename specified in an XML format.| Constructor and Description |
|---|
InvalidityReportGenerator(Configuration config,
Destination destination)
Create a Report Invalidity Handler writing to a s9api Destination
|
InvalidityReportGenerator(Configuration config,
Receiver receiver)
Create a Report Invalidity Handler writing to a Receiver
|
| Modifier and Type | Method and Description |
|---|---|
void |
createMetaData()
Create metedata element which contains summary information in the output XML document
|
Sequence |
endReporting()
Get the value to be associated with a validation exception.
|
Destination |
getDestination() |
int |
getErrorCount() |
int |
getWarningCount() |
XMLStreamWriter |
getWriter() |
void |
reportInvalidity(Invalidity failure)
Receive notification of a validity error.
|
void |
setDestination(Destination destination)
Set the writer
|
void |
setSchemaName(String name)
Set the XSD document used to validation process
|
void |
setSystemId(String id)
Set the XML document that is to be validated
|
void |
setXsdVersion(String version) |
void |
startReporting(String systemId)
At the start of a validation episode, initialize the handler
|
abbreviatePath, getConfiguration, getConstraintReferenceMessage, getExpandedMessage, getLocationMessage, getLogger, setLoggerpublic InvalidityReportGenerator(Configuration config, Destination destination) throws SaxonApiException
config - the Saxon configurationdestination - required to output the validation errorsSaxonApiExceptionpublic InvalidityReportGenerator(Configuration config, Receiver receiver) throws XPathException
config - the Saxon configurationreceiver - required to output the validation errorsXPathExceptionpublic void setDestination(Destination destination) throws SaxonApiException
destination - required to output the validation errorsSaxonApiExceptionpublic void setSystemId(String id)
id - of the source documentpublic void setSchemaName(String name)
name - of xsd filepublic int getErrorCount()
public int getWarningCount()
public void setXsdVersion(String version)
public XMLStreamWriter getWriter()
public void reportInvalidity(Invalidity failure) throws XPathException
reportInvalidity in interface InvalidityHandlerreportInvalidity in class StandardInvalidityHandlerfailure - Information about the nature of the invalidityXPathException - - if the validation error cannot be reported.
This is fatal and will cause the validation run to be abandonedpublic Destination getDestination()
public void startReporting(String systemId) throws XPathException
StandardInvalidityHandlerstartReporting in interface InvalidityHandlerstartReporting in class StandardInvalidityHandlersystemId - optional; may be used to represent the destination of any report producedXPathException - if initialization of the invalidity handler fails for any reasonpublic Sequence endReporting() throws XPathException
StandardInvalidityHandlerendReporting in interface InvalidityHandlerendReporting in class StandardInvalidityHandlerXPathException - if an error occurs creating any validation reportpublic void createMetaData()
throws XPathException
XPathExceptionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.