Class TraXLiaison
- java.lang.Object
- 
- org.apache.tools.ant.taskdefs.optional.TraXLiaison
 
- 
- All Implemented Interfaces:
- javax.xml.transform.ErrorListener,- XSLTLiaison,- XSLTLiaison2,- XSLTLiaison3,- XSLTLiaison4,- XSLTLoggerAware
 
 public class TraXLiaison extends java.lang.Object implements XSLTLiaison4, javax.xml.transform.ErrorListener, XSLTLoggerAware Concrete liaison for XSLT processor implementing TraX. (ie JAXP 1.1)- Since:
- Ant 1.3
 
- 
- 
Field Summary- 
Fields inherited from interface org.apache.tools.ant.taskdefs.XSLTLiaisonFILE_PROTOCOL_PREFIX
 
- 
 - 
Constructor SummaryConstructors Constructor Description TraXLiaison()Constructor for TraXLiaison.
 - 
Method SummaryModifier and Type Method Description voidaddParam(java.lang.String name, java.lang.Object value)Add a parameter.voidaddParam(java.lang.String name, java.lang.String value)Add a parameter.voidconfigure(XSLTProcess xsltTask)Specific configuration for the TRaX liaison.voiderror(javax.xml.transform.TransformerException e)Log an error.voidfatalError(javax.xml.transform.TransformerException e)Log a fatal error.protected java.lang.StringgetSystemId(java.io.File file)Deprecated.since 1.5.x.voidsetAttribute(java.lang.String name, java.lang.Object value)Set a custom attribute for the JAXP factory implementation.voidsetEntityResolver(org.xml.sax.EntityResolver aResolver)Set the class to resolve entities during the transformation.voidsetFactory(java.lang.String name)Set the factory name to use instead of JAXP default lookup.voidsetFeature(java.lang.String name, boolean value)Set a custom feature for the JAXP factory implementation.voidsetLogger(XSLTLogger l)Set a logger.voidsetOutputProperty(java.lang.String name, java.lang.String value)Set the output property for the current transformer.voidsetStylesheet(java.io.File stylesheet)Set the stylesheet file.voidsetStylesheet(Resource stylesheet)Set the stylesheet file.voidsetURIResolver(javax.xml.transform.URIResolver aResolver)Set the class to resolve URIs during the transformationvoidtransform(java.io.File infile, java.io.File outfile)Transform an input file.voidwarning(javax.xml.transform.TransformerException e)Log a warning.
 
- 
- 
- 
Method Detail- 
setStylesheetpublic void setStylesheet(java.io.File stylesheet) throws java.lang.ExceptionSet the stylesheet file.- Specified by:
- setStylesheetin interface- XSLTLiaison
- Parameters:
- stylesheet- a- Filevalue
- Throws:
- java.lang.Exception- on error
 
 - 
setStylesheetpublic void setStylesheet(Resource stylesheet) throws java.lang.Exception Set the stylesheet file.- Specified by:
- setStylesheetin interface- XSLTLiaison3
- Parameters:
- stylesheet- a- Resourcevalue
- Throws:
- java.lang.Exception- on error
 
 - 
transformpublic void transform(java.io.File infile, java.io.File outfile) throws java.lang.ExceptionTransform an input file.- Specified by:
- transformin interface- XSLTLiaison
- Parameters:
- infile- the file to transform
- outfile- the result file
- Throws:
- java.lang.Exception- on error
- See Also:
- XSLTLiaison.setStylesheet(File)
 
 - 
setFactorypublic void setFactory(java.lang.String name) Set the factory name to use instead of JAXP default lookup.- Parameters:
- name- the fully qualified class name of the factory to use or null for the default JAXP look up mechanism.
- Since:
- Ant 1.6
 
 - 
setAttributepublic void setAttribute(java.lang.String name, java.lang.Object value)Set a custom attribute for the JAXP factory implementation.- Parameters:
- name- the attribute name.
- value- the value of the attribute, usually a boolean string or object.
- Since:
- Ant 1.6
 
 - 
setFeaturepublic void setFeature(java.lang.String name, boolean value)Set a custom feature for the JAXP factory implementation.- Parameters:
- name- the feature name.
- value- the value of the feature
- Since:
- Ant 1.9.8
 
 - 
setOutputPropertypublic void setOutputProperty(java.lang.String name, java.lang.String value)Set the output property for the current transformer. Note that the stylesheet must be set prior to calling this method.- Parameters:
- name- the output property name.
- value- the output property value.
- Since:
- Ant 1.5, Ant 1.5
 
 - 
setEntityResolverpublic void setEntityResolver(org.xml.sax.EntityResolver aResolver) Set the class to resolve entities during the transformation.- Parameters:
- aResolver- the resolver class.
 
 - 
setURIResolverpublic void setURIResolver(javax.xml.transform.URIResolver aResolver) Set the class to resolve URIs during the transformation- Parameters:
- aResolver- a- EntityResolvervalue
 
 - 
addParampublic void addParam(java.lang.String name, java.lang.String value)Add a parameter.- Specified by:
- addParamin interface- XSLTLiaison
- Parameters:
- name- the name of the parameter
- value- the value of the parameter
- See Also:
- XSLTLiaison4.addParam(java.lang.String, java.lang.Object)
 
 - 
addParampublic void addParam(java.lang.String name, java.lang.Object value)Add a parameter.- Specified by:
- addParamin interface- XSLTLiaison4
- Parameters:
- name- the name of the parameter
- value- the value of the parameter
- Since:
- Ant 1.9.3
- See Also:
- Transformer.setParameter(java.lang.String, java.lang.Object)
 
 - 
setLoggerpublic void setLogger(XSLTLogger l) Set a logger.- Specified by:
- setLoggerin interface- XSLTLoggerAware
- Parameters:
- l- a logger.
 
 - 
errorpublic void error(javax.xml.transform.TransformerException e) Log an error.- Specified by:
- errorin interface- javax.xml.transform.ErrorListener
- Parameters:
- e- the exception to log.
 
 - 
fatalErrorpublic void fatalError(javax.xml.transform.TransformerException e) Log a fatal error.- Specified by:
- fatalErrorin interface- javax.xml.transform.ErrorListener
- Parameters:
- e- the exception to log.
 
 - 
warningpublic void warning(javax.xml.transform.TransformerException e) Log a warning.- Specified by:
- warningin interface- javax.xml.transform.ErrorListener
- Parameters:
- e- the exception to log.
 
 - 
getSystemId@Deprecated protected java.lang.String getSystemId(java.io.File file) Deprecated.since 1.5.x. Use org.apache.tools.ant.util.JAXPUtils#getSystemId instead.- Parameters:
- file- the filename to use for the systemid
- Returns:
- the systemid
 
 - 
configurepublic void configure(XSLTProcess xsltTask) Specific configuration for the TRaX liaison.- Specified by:
- configurein interface- XSLTLiaison2
- Parameters:
- xsltTask- the XSLTProcess task instance from which this liaison is to be configured.
 
 
- 
 
-