public class Validate extends 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 String |
topLevelElementName |
protected boolean |
useURLs |
protected 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(String message)
Report incorrect usage of the command line, with a list of the options and arguments that are available
|
int |
doValidate(String[] args)
Support method for main program.
|
static Source |
loadDocument(String sourceFileName,
boolean useURLs,
Configuration config)
Load a document, given a filename or URL
|
static void |
main(String[] args)
Main program, can be used directly from the command line.
|
void |
processFile(Source source,
SchemaValidator validator)
Process a single file using a supplied schema
|
protected static int |
quit(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 String validationMode
protected int xsdLanguageVersion
protected String topLevelElementName
public static void main(String[] args) throws Exception
args
- List of arguments supplied on operating system command lineException
- 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(String[] args)
args
- the command-line argumentsprotected void applyLocalOptions(CommandLineOptions options, Configuration config)
options
- the CommandLineOptionsconfig
- the Saxon Configurationprotected static int quit(String message, int code)
message
- The message to be outputcode
- The result code to be returned to the operating
system shellpublic static Source loadDocument(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(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(String message)
message
- The error messageCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.