net.sf.saxon
public class Query extends Object
The XQuery syntax supported conforms to the W3C XQuery 1.0 drafts.
Field Summary | |
---|---|
protected boolean | backup |
protected Configuration | config |
protected boolean | explain |
protected String | explainOutputFileName |
protected String | languageVersion |
protected String | moduleURIResolverClass |
protected String | outputFileName |
protected Properties | outputProperties |
protected boolean | projection |
protected boolean | pullMode |
protected String | queryFileName |
protected int | repeat |
protected boolean | showTime |
protected String | sourceFileName |
protected boolean | updating |
protected String | uriResolverClass |
protected boolean | useURLs |
protected boolean | wrap |
protected boolean | writeback |
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 XQueryExpression | compileQuery(StaticQueryContext staticEnv, String queryFileName, boolean useURLs)
Compile the query
|
protected void | doQuery(String[] args, String command)
Support method for main program. |
protected void | explain(XQueryExpression exp)
Explain the results of query compilation
|
protected Configuration | getConfiguration()
Get the configuration in use
|
protected static void | loadAdditionalSchemas(Configuration config, String additionalSchemas) |
static void | main(String[] args)
Main program, can be used directly from the command line.
|
protected void | parseOptions(String[] args, String command, StaticQueryContext staticEnv, DynamicQueryContext dynamicEnv)
Parse the options supplied on the command line |
protected void | processSource(Source sourceInput, XQueryExpression exp, DynamicQueryContext dynamicEnv)
Process the supplied source file
|
protected Source | processSourceFile(String sourceFileName, boolean useURLs) |
protected static void | quit(String message, int code)
Exit with a message
|
protected void | runQuery(XQueryExpression exp, DynamicQueryContext dynamicEnv, OutputStream destination, Properties outputProps)
Run the query
|
protected boolean | testIfSchemaAware(String[] args)
Prescan the command line arguments to see if any of them imply use of a schema-aware processor |
Parameters: name The name of the command being executed (allows subclassing) message The error message
Parameters: staticEnv the static query context queryFileName the filename holding the query (or "-" for the standard input) useURLs true if the filename is in the form of a URI
Returns: the compiled query
Throws: XPathException if query compilation fails IOException if the query cannot be read
Parameters: args the command-line arguments command name of the class, to be used in error messages
Parameters: exp the compiled expression
Throws: FileNotFoundException if the destination for the explanation doesn't exist XPathException if other failures occur
Returns: the configuration
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
Parameters: args the command line arguments command the name of the command that was used (for diagnostics only) dynamicEnv the XQuery dynamic context
Throws: TransformerException if failures occur. Note, the method may also invoke System.exit().
Parameters: sourceInput the supplied source exp the compiled XQuery expression dynamicEnv the dynamic query context
Throws: XPathException if processing fails
Parameters: message The message to be output code The result code to be returned to the operating system shell
Parameters: exp the compiled query expression dynamicEnv the dynamic query context destination the destination for serialized results outputProps serialization properties defining the output format
Throws: XPathException if the query fails IOException if input or output fails
Parameters: args the command line arguments
Returns: true if a schema-aware processor is needed