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 causes a source document to be parsed and validated against a schema. Apart from error messages, no output is produced.


Field Summary
protected  EnterpriseConfiguration config
           
protected  int repeat
           
protected  boolean showTime
           
protected  String topLevelElementName
           
protected  boolean useURLs
           
protected  int validationMode
           
protected  int xsdLanguageVersion
           
 
Constructor Summary
Validate()
           
 
Method Summary
protected  void badUsage(String name, 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, String name)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected EnterpriseConfiguration config

useURLs

protected boolean useURLs

showTime

protected boolean showTime

repeat

protected int repeat

validationMode

protected int validationMode

xsdLanguageVersion

protected int xsdLanguageVersion

topLevelElementName

protected String topLevelElementName
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


doValidate

protected void doValidate(String[] args,
                          String name)
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
name - name of the class, to be used in error messages

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 name,
                        String message)
Report incorrect usage of the command line, with a list of the options and arguments that are available

Parameters:
name - The name of the command being executed (allows subclassing)
message - The error message


Copyright (c) Saxonica Limited. All rights reserved.