net.sf.saxon
Class Query

java.lang.Object
  extended by net.sf.saxon.Query

public class Query
extends Object

This Query class provides a command-line interface to the Saxon XQuery processor.

The XQuery syntax supported conforms to the W3C XQuery 1.0 drafts.

Author:
M.H.Kay (michael.h.kay@ntlworld.com)

Field Summary
(package private)  Configuration config
           
 
Constructor Summary
Query()
           
 
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 doMain(String[] args, String name)
          Support method for main program.
static void main(String[] args)
          Main program, can be used directly from the command line.
protected  Configuration makeConfiguration()
          Set the configuration.
static URIResolver makeURIResolver(String className)
          Create an instance of a URIResolver with a specified class name
protected static void quit(String message, int code)
          Exit with a message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

Configuration config
Constructor Detail

Query

public Query()
Method Detail

makeConfiguration

protected Configuration makeConfiguration()
Set the configuration. This is designed to be overridden in a subclass


main

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

The format is:

java net.sf.saxon.Query [options] query-file >output-file

followed by any number of parameters in the form {keyword=value}... which can be referenced from within the query.

This program executes the query in query-file.

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

doMain

protected void doMain(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

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

makeURIResolver

public static URIResolver makeURIResolver(String className)
                                   throws TransformerException
Create an instance of a URIResolver with a specified class name

Parameters:
className - The fully-qualified name of the URIResolver class
Returns:
The newly created URIResolver
Throws:
TransformerException - if the requested class does not implement the javax.xml.transform.URIResolver interface