com.saxonica
Class Validate

java.lang.Object
  extended by com.saxonica.Validate

public class Validate
extends Object

This Validate class provides a command line interface that allows validation of a source document against a schema, and/or checking that a source schema is a valid schema.

Apart from error and optional progress messages, no output is produced.


Field Summary
protected  EnterpriseConfiguration config
           
protected  Controller controller
           
protected  int repeat
           
protected  boolean showTime
           
protected  StatisticsReporter statsReporter
           
protected  String topLevelElementName
           
protected  boolean useURLs
           
protected  int validationMode
           
protected  int xsdLanguageVersion
           
 
Constructor Summary
Validate()
           
 
Method Summary
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
protected  void 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)
          Process a single file using a supplied schema
protected static void 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected EnterpriseConfiguration config

controller

protected Controller controller

useURLs

protected boolean useURLs

showTime

protected boolean showTime

repeat

protected int repeat

validationMode

protected int validationMode

xsdLanguageVersion

protected int xsdLanguageVersion

topLevelElementName

protected String topLevelElementName

statsReporter

protected StatisticsReporter statsReporter
Constructor Detail

Validate

public Validate()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Main program, can be used directly from the command line.

Parameters:
args - List of arguments supplied on operating system command line
Throws:
Exception - Indicates that a compile-time or run-time error occurred

setConfiguration

protected void setConfiguration()
Create the configuration. This method is intended to be overridden in a subclass


setPermittedOptions

public void setPermittedOptions(CommandLineOptions options)
Set the options that are recognized on the command line. This method can be overridden in a subclass to define additional command line options.

Parameters:
options - the CommandLineOptions in which the recognized options are to be registered.

doValidate

protected void doValidate(String[] args)
Support method for main program. This support method can also be invoked from subclasses that support the same command line interface

Parameters:
args - the command-line arguments

applyLocalOptions

protected void applyLocalOptions(CommandLineOptions options,
                                 Configuration config)
Customisation hook: apply options defined locally in a subclass

Parameters:
options - the CommandLineOptions
config - the Saxon Configuration

quit

protected static void quit(String message,
                           int code)
Exit with a message

Parameters:
message - The message to be output
code - The result code to be returned to the operating system shell

loadDocument

public static Source loadDocument(String sourceFileName,
                                  boolean useURLs,
                                  Configuration config)
                           throws TransformerException
Load a document, given a filename or URL

Parameters:
sourceFileName - the name of the source file
useURLs - true if name is to be treated as a URI
config - the Saxon configuration
Returns:
the Source object that results from loading the document
Throws:
TransformerException

processFile

public void processFile(Source source)
                 throws TransformerException
Process a single file using a supplied schema

Parameters:
source - The source XML document to be transformed
Throws:
TransformerException - If the transformation fails

badUsage

protected void badUsage(String message)
Report incorrect usage of the command line, with a list of the options and arguments that are available

Parameters:
message - The error message


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.