|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task org.apache.tools.ant.taskdefs.MatchingTask net.sf.saxon.ant.AntTransform
public class AntTransform
Processes a set of XML documents via XSLT. This is useful for building views of XML based documentation. This task for running Saxon transformations within Ant is modelled on the standard Ant xslt task (org.apache.tools.ant.taskdefs.XSLTProcess), and makes heavy reuse of its code. See Apache notice above.
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 |
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
---|
fileset |
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
AntTransform()
Create a new saxon-xslt Task. |
Method Summary | |
---|---|
void |
add(org.apache.tools.ant.util.FileNameMapper fileNameMapper)
Adds a nested filenamemapper. |
void |
add(org.apache.tools.ant.types.ResourceCollection rc)
Adds a collection of resources to style in addition to the given file or the implicit fileset. |
void |
addConfiguredStyle(org.apache.tools.ant.types.resources.Resources rc)
Add a nested <style> element. |
void |
addConfiguredXMLCatalog(org.apache.tools.ant.types.XMLCatalog xmlCatalog)
Add the catalog to our internal catalog |
void |
addMapper(org.apache.tools.ant.types.Mapper mapper)
Defines the mapper to map source to destination files. |
protected void |
configureLiaison(File stylesheet)
Deprecated. since Ant 1.7 |
protected void |
configureLiaison(org.apache.tools.ant.types.Resource stylesheet)
Loads the stylesheet and set xsl:param parameters. |
org.apache.tools.ant.types.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. |
org.apache.tools.ant.types.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(org.apache.tools.ant.types.Path classpath)
Set the optional classpath to the XSL processor |
void |
setClasspathRef(org.apache.tools.ant.types.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(org.apache.tools.ant.types.Resource xslResource)
API method to set the XSL Resource. |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
---|
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.tools.ant.taskdefs.XSLTLogger |
---|
log |
Constructor Detail |
---|
public AntTransform()
Method Detail |
---|
public void setScanIncludedDirectories(boolean b)
b
- true if files in included directories are processed.public void setReloadStylesheet(boolean b)
Setting this to true may get around a bug in certain Xalan-J versions, default is false.
b
- a boolean
valuepublic void addMapper(org.apache.tools.ant.types.Mapper mapper)
mapper
- the mapper to use
org.apache.tools.ant.BuildException
- if more than one mapper is definedpublic void add(org.apache.tools.ant.types.ResourceCollection rc)
rc
- the collection of resources to stylepublic void addConfiguredStyle(org.apache.tools.ant.types.resources.Resources rc)
rc
- the configured Resources object represented as <style>.public void setXslResource(org.apache.tools.ant.types.Resource xslResource)
xslResource
- Resource to set as the stylesheet.public void add(org.apache.tools.ant.util.FileNameMapper fileNameMapper) throws org.apache.tools.ant.BuildException
fileNameMapper
- the mapper to add
org.apache.tools.ant.BuildException
- if more than one mapper is definedpublic void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- if there is an execution problem.public void setForce(boolean force)
force
- true if always generate.public void setBasedir(File dir)
dir
- the base directorypublic void setDestdir(File dir)
dir
- the name of the destination directorypublic void setExtension(String name)
name
- the extension to usepublic void setStyle(String xslFile)
xslFile
- the stylesheet to usepublic void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath
- the classpath to use when loading the XSL processorpublic org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
r
- the id of the Ant path instance to act as the classpath
for loading the XSL processorpublic void setSchemaAware(boolean schemaAware)
schemaAware
- true if schema-aware processing is requiredpublic void setSchemaValidation(String validation)
validation
- "strict", "lax" or "skip"public void setDTDValidation(boolean validation)
validation
- set to true to request DTD validation of all input files to the transformationpublic void setExpandDefaults(boolean expand)
expand
- true to expand default values, false if they are to be suppressedpublic void setInitialMode(String mode)
mode
- the initial mode for the transformation, in Clark notationpublic void setInitialTemplate(String name)
name
- the name of the initial template for the transformation, in Clark notationpublic void setRecoveryPolicy(String policy)
policy
- one of "silent", "recover", or "fatal". Default is "recover".public void setTracing(boolean tracing)
tracing
- true to trace execution. Default is falsepublic void setLineNumbering(boolean numbering)
numbering
- true to maintain line numbers. Default is falsepublic void setXmlVersion(String version)
version
- One of "1.0" or "1.1". Default is "1.0".public void setUseImplicitFileset(boolean useimplicitfileset)
Set this to false if you want explicit control with nested resource collections.
useimplicitfileset
- set to true if you want to use implicit filesetpublic void addConfiguredXMLCatalog(org.apache.tools.ant.types.XMLCatalog xmlCatalog)
xmlCatalog
- the XMLCatalog instance to use to look up DTDspublic void setFileNameParameter(String fileNameParameter)
fileNameParameter
- name of the xsl parameter retrieving the
current file namepublic void setFileDirParameter(String fileDirParameter)
fileDirParameter
- name of the xsl parameter retrieving the
current file directorypublic void setOut(File outFile)
outFile
- the output File instance.public void setIn(File inFile)
inFile
- the input filepublic Configuration getConfiguration()
public org.apache.tools.ant.types.XMLCatalog getXMLCatalog()
public Enumeration getOutputProperties()
public AntTransform.Param createParam()
public AntTransform.OutputProperty createOutputProperty()
public void init() throws org.apache.tools.ant.BuildException
init
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- on errorprotected void configureLiaison(File stylesheet) throws org.apache.tools.ant.BuildException
stylesheet
- the file from which to load the stylesheet.
org.apache.tools.ant.BuildException
- if the stylesheet cannot be loaded.protected void configureLiaison(org.apache.tools.ant.types.Resource stylesheet) throws org.apache.tools.ant.BuildException
stylesheet
- the resource from which to load the stylesheet.
org.apache.tools.ant.BuildException
- if the stylesheet cannot be loaded.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |