net.sf.saxon.ant
public class AntTransform extends MatchingTask implements XSLTLogger
Nested Class Summary | |
---|---|
static class | AntTransform.OutputProperty
Specify how the result tree should be output as specified
in the Serialization specification. |
static class | AntTransform.Param
The Param inner class used to store XSL parameters |
Constructor Summary | |
---|---|
AntTransform()
Create a new saxon-xslt Task. |
Method Summary | |
---|---|
void | add(ResourceCollection rc)
Adds a collection of resources to style in addition to the
given file or the implicit fileset.
|
void | add(FileNameMapper fileNameMapper)
Adds a nested filenamemapper. |
void | addConfiguredStyle(Resources rc)
Add a nested <style> element. |
void | addConfiguredXMLCatalog(XMLCatalog xmlCatalog)
Add the catalog to our internal catalog
|
void | addMapper(Mapper mapper)
Defines the mapper to map source to destination files. |
protected void | configureLiaison(File stylesheet)
Loads the stylesheet and set xsl:param parameters.
|
protected void | configureLiaison(Resource stylesheet)
Loads the stylesheet and set xsl:param parameters.
|
Path | createClasspath()
Set the optional classpath to the XSL processor
|
AntTransform.OutputProperty | createOutputProperty()
Create an instance of an output property to be configured. |
AntTransform.Param | createParam()
Create an instance of an XSL parameter for configuration by Ant.
|
void | execute()
Executes the task.
|
Configuration | getConfiguration()
Get the Saxon Configuration being used (useful for subclasses) |
Enumeration | getOutputProperties()
Get an enumeration on the outputproperties. |
XMLCatalog | getXMLCatalog()
Get the XML catalog containing entity definitions
|
void | init()
Initialize internal instance of XMLCatalog |
void | setBasedir(File dir)
Set the base directory;
optional, default is the project's basedir.
|
void | setClasspath(Path classpath)
Set the optional classpath to the XSL processor
|
void | setClasspathRef(Reference r)
Set the reference to an optional classpath to the XSL processor
|
void | setDestdir(File dir)
Set the destination directory into which the XSL result
files should be copied to;
required, unless in and out are
specified. |
void | setDTDValidation(boolean validation)
Indicate whether DTD validation is on or off |
void | setExpandDefaults(boolean expand)
Set whether DTD or schema-defined element and attribute default values should be expanded
Default is true |
void | setExtension(String name)
Set the desired file extension to be used for the target;
optional, default is html. |
void | setFileDirParameter(String fileDirParameter)
Pass the directory name of the current processed file as a xsl parameter
to the transformation. |
void | setFileNameParameter(String fileNameParameter)
Pass the filename of the current processed file as a xsl parameter
to the transformation. |
void | setForce(boolean force)
Set whether to check dependencies, or always generate;
optional, default is false.
|
void | setIn(File inFile)
specifies a single XML document to be styled. |
void | setInitialMode(String mode)
Set the initial mode |
void | setInitialTemplate(String name)
Set the initial template |
void | setLineNumbering(boolean numbering)
Set whether to maintain line numbers for input documents |
void | setOut(File outFile)
Specifies the output name for the styled result from the
in attribute; required if in is set
|
void | setRecoveryPolicy(String policy)
Set the policy for handling recoverable errors |
void | setReloadStylesheet(boolean b)
Controls whether the stylesheet is reloaded for every transform.
|
void | setScanIncludedDirectories(boolean b)
Set whether to style all files in the included directories as well;
optional, default is true.
|
void | setSchemaAware(boolean schemaAware)
Indicate whether schema-aware processing is required
|
void | setSchemaValidation(String validation)
Indicate whether schema validation for all input files to the transformation is strict, lax, or skip |
void | setStyle(String xslFile)
Name of the stylesheet to use - given either relative
to the project's basedir or as an absolute path; required.
|
void | setTracing(boolean tracing)
Set whether to trace stylesheet execution |
void | setUseImplicitFileset(boolean useimplicitfileset)
Set whether to use the implicit fileset.
|
void | setXmlVersion(String version)
Set the XML version to be used for validating names |
void | setXslResource(Resource xslResource)
API method to set the XSL Resource. |
Parameters: rc the collection of resources to style
Since: Ant 1.7
Parameters: fileNameMapper the mapper to add
Throws: BuildException if more than one mapper is defined
Since: Ant 1.7.0
Parameters: rc the configured Resources object represented as <style>.
Since: Ant 1.7
Parameters: xmlCatalog the XMLCatalog instance to use to look up DTDs
Parameters: mapper the mapper to use
Throws: BuildException if more than one mapper is defined
Since: Ant 1.6.2
Deprecated: since Ant 1.7
Loads the stylesheet and set xsl:param parameters.Parameters: stylesheet the file from which to load the stylesheet.
Throws: BuildException if the stylesheet cannot be loaded.
Parameters: stylesheet the resource from which to load the stylesheet.
Throws: BuildException if the stylesheet cannot be loaded.
Since: Ant 1.7
Returns: a path instance to be configured by the Ant core.
Returns: the newly created output property.
Since: Ant 1.5
Returns: an instance of the Param class to be configured.
Throws: BuildException if there is an execution problem.
Returns: the Saxon Configuration
Returns: the outputproperties
Returns: the XML catalog for the task.
Throws: BuildException on error
Parameters: dir the base directory
Parameters: classpath the classpath to use when loading the XSL processor
Parameters: r the id of the Ant path instance to act as the classpath for loading the XSL processor
Parameters: dir the name of the destination directory
Parameters: validation set to true to request DTD validation of all input files to the transformation
Parameters: expand true to expand default values, false if they are to be suppressed
Parameters: name the extension to use
Parameters: fileDirParameter name of the xsl parameter retrieving the current file directory
Parameters: fileNameParameter name of the xsl parameter retrieving the current file name
Parameters: force true if always generate.
Parameters: inFile the input file
Parameters: mode the initial mode for the transformation, in Clark notation
Parameters: name the name of the initial template for the transformation, in Clark notation
Parameters: numbering true to maintain line numbers. Default is false
Parameters: outFile the output File instance.
Parameters: policy one of "silent", "recover", or "fatal". Default is "recover".
Setting this to true may get around a bug in certain Xalan-J versions, default is false.
Parameters: b a boolean
value
Since: Ant 1.5.2
Parameters: b true if files in included directories are processed.
Since: Ant 1.5
Parameters: schemaAware true if schema-aware processing is required
Parameters: validation "strict", "lax" or "skip"
Parameters: xslFile the stylesheet to use
Parameters: tracing true to trace execution. Default is false
Set this to false if you want explicit control with nested resource collections.
Parameters: useimplicitfileset set to true if you want to use implicit fileset
Since: Ant 1.7
Parameters: version One of "1.0" or "1.1". Default is "1.0".
Parameters: xslResource Resource to set as the stylesheet.
Since: Ant 1.7