public class Validate
extends java.lang.Object
Apart from error and optional progress messages, no output is produced.
| Modifier and Type | Field and Description |
|---|---|
protected EnterpriseConfiguration |
config |
protected Processor |
processor |
protected int |
repeat |
protected boolean |
showTime |
protected java.lang.String |
topLevelElementName |
protected boolean |
useURLs |
protected java.lang.String |
validationMode |
protected int |
xsdLanguageVersion |
| Constructor and Description |
|---|
Validate() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyLocalOptions(CommandLineOptions options,
Configuration config)
Customisation hook: apply options defined locally in a subclass
|
protected void |
badUsage(java.lang.String message)
Report incorrect usage of the command line, with a list of the options and arguments that are available
|
int |
doValidate(java.lang.String[] args)
Support method for main program.
|
static javax.xml.transform.Source |
loadDocument(java.lang.String sourceFileName,
boolean useURLs,
Configuration config)
Load a document, given a filename or URL
|
static void |
main(java.lang.String[] args)
Main program, can be used directly from the command line.
|
void |
processFile(javax.xml.transform.Source source,
SchemaValidator validator)
Process a single file using a supplied schema
|
protected static int |
quit(java.lang.String message,
int code)
Exit with a message
|
protected void |
setConfiguration()
Create the configuration.
|
void |
setPermittedOptions(CommandLineOptions options)
Set the options that are recognized on the command line.
|
protected Processor processor
protected EnterpriseConfiguration config
protected boolean useURLs
protected boolean showTime
protected int repeat
protected java.lang.String validationMode
protected int xsdLanguageVersion
protected java.lang.String topLevelElementName
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - List of arguments supplied on operating system command linejava.lang.Exception - Indicates that a compile-time or
run-time error occurredprotected void setConfiguration()
public void setPermittedOptions(CommandLineOptions options)
options - the CommandLineOptions in which the recognized options are to be registered.public int doValidate(java.lang.String[] args)
args - the command-line argumentsprotected void applyLocalOptions(CommandLineOptions options, Configuration config)
options - the CommandLineOptionsconfig - the Saxon Configurationprotected static int quit(java.lang.String message,
int code)
message - The message to be outputcode - The result code to be returned to the operating
system shellpublic static javax.xml.transform.Source loadDocument(java.lang.String sourceFileName,
boolean useURLs,
Configuration config)
throws XPathException
sourceFileName - the name of the source fileuseURLs - true if name is to be treated as a URIconfig - the Saxon configurationXPathException - if a document cannot be loadedpublic void processFile(javax.xml.transform.Source source,
SchemaValidator validator)
throws SaxonApiException
source - The source XML document to be validatedvalidator - The schema validator used to perform the validationSaxonApiException - If the validation fails (or if validation could not be attempted)protected void badUsage(java.lang.String message)
message - The error messageCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.