|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.Transform
public class Transform
This Transform class is the command-line entry point to the Saxon XSLT Processor.
It is possible to subclass this class to provide a customized command line interface. In writing such a subclass:
main(java.lang.String[])
method should instantiate the class and call the doTransform(java.lang.String[], java.lang.String)
method, passing the
argument list. The argument list can be augmented or modified if required: for example, by adding a -config
argument to cause the configuration to be initialized from a configuration file.setFactoryConfiguration(boolean, java.lang.String)
method can be implemented
Field Summary | |
---|---|
protected CompilerInfo |
compilerInfo
|
protected Configuration |
config
|
protected int |
repeat
|
protected boolean |
showTime
|
protected boolean |
useURLs
|
Constructor Summary | |
---|---|
Transform()
|
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 |
void |
doTransform(String[] args,
String command)
Support method for main program. |
protected Configuration |
getConfiguration()
Get the configuration. |
protected void |
initializeConfiguration(Configuration config)
Customisation hook called immediately after the Configuration object is instantiated. |
static void |
main(String[] args)
Main program, can be used directly from the command line. |
protected Controller |
newController(Templates sheet,
CommandLineOptions options,
PrintStream traceDestination)
Create a new Controller. |
List |
preprocess(List sources)
Preprocess the list of sources. |
protected static void |
quit(String message,
int code)
Exit with a message |
void |
setFactoryConfiguration(boolean schemaAware,
String className)
Customisation hook called immediately after the Configuration object is instantiated. |
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 |
---|
protected Configuration config
protected CompilerInfo compilerInfo
protected boolean useURLs
protected boolean showTime
protected int repeat
Constructor Detail |
---|
public Transform()
Method Detail |
---|
public static void main(String[] args) throws Exception
The format is:
java net.sf.saxon.Transform [options] source-file style-file >output-file
followed by any number of parameters in the form {keyword=value}... which can be referenced from within the stylesheet.
This program applies the XSL style sheet in style-file to the source XML document in source-file.
args
- List of arguments supplied on operating system command line
Exception
- Indicates that a compile-time or
run-time error occurredpublic void setPermittedOptions(CommandLineOptions options)
options
- the CommandLineOptions in which the recognized options are to be registered.public void doTransform(String[] args, String command)
args
- the command-line argumentscommand
- the form of the command as written by the user. Not used, retained for backwards compatibilityprotected void initializeConfiguration(Configuration config)
config
- the Configuration objectpublic void setFactoryConfiguration(boolean schemaAware, String className) throws LicenseException
initializeConfiguration(net.sf.saxon.Configuration)
in preference. This method is called after initializeConfiguration(net.sf.saxon.Configuration)
,
but only if the configuration was not created using a configuration file.
The default implementation does nothing.
schemaAware
- True if the transformation is to be schema-awareclassName
- Always null.
LicenseException
- can be thrown if there is no valid license availableprotected void applyLocalOptions(CommandLineOptions options, Configuration config)
setPermittedOptions(net.sf.saxon.trans.CommandLineOptions)
must be overridden in the subclass to add details of
options recognized in the subclass.
options
- the CommandLineOptions. This will contain details of all the options
that were specified on the command line. Those that are recognized by the standard Saxon
command line interface will already have been processed; other options can now be processed
by the subclass.config
- the Saxon Configurationpublic List preprocess(List sources) throws XPathException
sources
- the list of Source objects
XPathException
protected Configuration getConfiguration()
protected static void quit(String message, int code)
message
- The message to be outputcode
- The result code to be returned to the operating
system shellprotected Controller newController(Templates sheet, CommandLineOptions options, PrintStream traceDestination) throws TransformerException
sheet
- The Templates object representing the compiled stylesheetoptions
- The commmand line optionstraceDestination
- destination for trace output
TransformerException
- if any error occursprotected void badUsage(String message)
message
- The error message
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |