|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.Transform
public class Transform
This Transform class is the entry point to the Saxon XSLT Processor. This class is provided to control the processor from the command line.
The XSLT syntax supported conforms to the W3C XSLT 1.0 and XPath 1.0 recommendation. Only the transformation language is implemented (not the formatting objects). Saxon extensions are documented in the file extensions.html
Field Summary | |
---|---|
protected Configuration |
config
|
protected TransformerFactoryImpl |
factory
|
protected NamePool |
namePool
|
protected int |
repeat
|
protected boolean |
showTime
|
protected boolean |
useURLs
|
Constructor Summary | |
---|---|
Transform()
|
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. |
void |
execute(String initialTemplate,
Templates sheet,
File outputFile,
ArrayList parameterList,
String initialMode)
Invoke a supplied stylesheet with no source document |
static List |
loadDocuments(String sourceFileName,
boolean useURLs,
Configuration config)
Load a document, or all the documents in a directory, given a filename or URL |
static void |
main(String[] args)
Main program, can be used directly from the command line. |
static TraceListener |
makeTraceListener(String className)
Create an instance of a TraceListener with a specified class name |
static URIResolver |
makeURIResolver(String className)
Create an instance of a URIResolver with a specified class name |
List |
preprocess(List sources)
Preprocess the list of sources. |
void |
processDirectory(List sources,
Templates sheet,
File outputDir,
ArrayList parameterList,
String initialMode)
Process each file in the source directory using the same supplied stylesheet |
void |
processDirectoryAssoc(List sources,
File outputDir,
ArrayList parameterList,
String initialMode)
Process each file in the source directory using its own associated stylesheet |
void |
processFile(Source source,
Templates sheet,
File outputFile,
ArrayList parameterList,
String initialMode)
Process a single file using a supplied stylesheet |
void |
processFileAssoc(Source sourceInput,
String localName,
File outputFile,
ArrayList parameterList,
String initialMode)
Process a single source file using its associated stylesheet(s) |
protected static void |
quit(String message,
int code)
Exit with a message |
protected void |
setFactoryConfiguration()
Set the configuration in the TransformerFactory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TransformerFactoryImpl factory
protected Configuration config
protected boolean useURLs
protected NamePool namePool
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 occurredprotected void setFactoryConfiguration()
protected void doMain(String[] args, String name)
args
- the command-line argumentsname
- name of the class, to be used in error messagespublic List preprocess(List sources) throws TransformerException
TransformerException
protected static void quit(String message, int code)
message
- The message to be outputcode
- The result code to be returned to the operating
system shellpublic static List loadDocuments(String sourceFileName, boolean useURLs, Configuration config) throws TransformerException
TransformerException
public void processDirectoryAssoc(List sources, File outputDir, ArrayList parameterList, String initialMode) throws Exception
sources
- The sources in the directory to be processedoutputDir
- The directory in which output files are to be
createdparameterList
- List of parameters to be supplied to each
transformationinitialMode
- Initial mode for executing each
transformation
Exception
- when any error occurs during a transformationpublic void processFileAssoc(Source sourceInput, String localName, File outputFile, ArrayList parameterList, String initialMode) throws TransformerException
sourceInput
- Identifies the source file to be transformedlocalName
- The local name of the file within the
directory, excluding the file type suffixoutputFile
- The output file to contain the results of the
transformationparameterList
- List of parameters to be supplied to the
transformationinitialMode
- Initial mode for executing the transformation
TransformerException
- If the transformation failspublic void processDirectory(List sources, Templates sheet, File outputDir, ArrayList parameterList, String initialMode) throws TransformerException
sources
- The sources in the directory to be processedsheet
- The Templates object identifying the stylesheetoutputDir
- The directory in which output files are to be
createdparameterList
- List of parameters to be supplied to each
transformationinitialMode
- Initial mode for executing each
transformation
TransformerException
- when any error occurs during a
transformationpublic void processFile(Source source, Templates sheet, File outputFile, ArrayList parameterList, String initialMode) throws TransformerException
source
- The source XML document to be transformedsheet
- The Templates object identifying the stylesheetoutputFile
- The output file to contain the results of the
transformationparameterList
- List of parameters to be supplied to the
transformationinitialMode
- Initial mode for executing the transformation
TransformerException
- If the transformation failspublic void execute(String initialTemplate, Templates sheet, File outputFile, ArrayList parameterList, String initialMode) throws TransformerException
initialTemplate
- The entry point to the stylesheetsheet
- The Templates object identifying the stylesheetoutputFile
- The output file to contain the results of the
transformationparameterList
- List of parameters to be supplied to the
transformationinitialMode
- Initial mode for executing the transformation
TransformerException
- If the transformation failsprotected void badUsage(String name, String message)
name
- The name of the command being executed (allows subclassing)message
- The error messagepublic static URIResolver makeURIResolver(String className) throws TransformerException
className
- The fully-qualified name of the URIResolver class
TransformerException
- if the requested class does not
implement the javax.xml.transform.URIResolver interfacepublic static TraceListener makeTraceListener(String className) throws TransformerException
className
- The fully qualified class name of the TraceListener to
be constructed
TransformerException
- if the requested class does not
implement the net.sf.saxon.trace.TraceListener interface
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |