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.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
REPORT_NS |
| Constructor and Description |
|---|
InvalidityReportGenerator(Configuration config) |
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.
|
int |
getErrorCount() |
int |
getWarningCount() |
javax.xml.stream.XMLStreamWriter |
getWriter() |
void |
reportInvalidity(Invalidity failure)
Receive notification of a validity error.
|
void |
setReceiver(Receiver receiver)
Set the receiver
|
void |
setSchemaName(java.lang.String name)
Set the XSD document used to validation process
|
void |
setSystemId(java.lang.String id)
Set the XML document that is to be validated
|
void |
setXsdVersion(java.lang.String version) |
void |
startReporting(java.lang.String systemId)
At the start of a validation episode, initialize the handler
|
abbreviatePath, getConfiguration, getConstraintReferenceMessage, getExpandedMessage, getLocationMessage, getLogger, setLoggerpublic static final java.lang.String REPORT_NS
public InvalidityReportGenerator(Configuration config)
public InvalidityReportGenerator(Configuration config, Receiver receiver) throws XPathException
config - the Saxon configurationreceiver - required to output the validation errorsXPathExceptionpublic void setReceiver(Receiver receiver)
receiver - required to output the validation errorspublic void setSystemId(java.lang.String id)
id - of the source documentpublic void setSchemaName(java.lang.String name)
name - of xsd filepublic int getErrorCount()
public int getWarningCount()
public void setXsdVersion(java.lang.String version)
public javax.xml.stream.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 void startReporting(java.lang.String systemId)
throws XPathException
startReporting 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-2020 Saxonica Limited. All rights reserved.