org.apache.tools.ant.taskdefs.optional

Class TraXLiaison

public class TraXLiaison extends Object implements XSLTLiaison3, ErrorListener, XSLTLoggerAware

Concrete liaison for XSLT processor implementing TraX. (ie JAXP 1.1)

Since: Ant 1.3

Constructor Summary
TraXLiaison()
Constructor for TraXLiaison.
Method Summary
voidaddParam(String name, String value)
Add a parameter.
voidconfigure(XSLTProcess xsltTask)
Specific configuration for the TRaX liaison.
voiderror(TransformerException e)
Log an error.
voidfatalError(TransformerException e)
Log a fatal error.
protected StringgetSystemId(File file)
voidsetAttribute(String name, Object value)
Set a custom attribute for the JAXP factory implementation.
voidsetEntityResolver(EntityResolver aResolver)
Set the class to resolve entities during the transformation.
voidsetFactory(String name)
Set the factory name to use instead of JAXP default lookup.
voidsetLogger(XSLTLogger l)
Set a logger.
voidsetOutputProperty(String name, String value)
Set the output property for the current transformer.
voidsetStylesheet(File stylesheet)
Set the stylesheet file.
voidsetStylesheet(Resource stylesheet)
Set the stylesheet file.
voidsetURIResolver(URIResolver aResolver)
Set the class to resolve URIs during the transformation
voidtransform(File infile, File outfile)
Transform an input file.
voidwarning(TransformerException e)
Log a warning.

Constructor Detail

TraXLiaison

public TraXLiaison()
Constructor for TraXLiaison.

Throws: Exception never

Method Detail

addParam

public void addParam(String name, String value)
Add a parameter.

Parameters: name the name of the parameter value the value of the parameter

configure

public void configure(XSLTProcess xsltTask)
Specific configuration for the TRaX liaison.

Parameters: xsltTask the XSLTProcess task instance from which this liasion is to be configured.

error

public void error(TransformerException e)
Log an error.

Parameters: e the exception to log.

fatalError

public void fatalError(TransformerException e)
Log a fatal error.

Parameters: e the exception to log.

getSystemId

protected String getSystemId(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

setAttribute

public void setAttribute(String name, 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

setEntityResolver

public void setEntityResolver(EntityResolver aResolver)
Set the class to resolve entities during the transformation.

Parameters: aResolver the resolver class.

setFactory

public void setFactory(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

setLogger

public void setLogger(XSLTLogger l)
Set a logger.

Parameters: l a logger.

setOutputProperty

public void setOutputProperty(String name, 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

setStylesheet

public void setStylesheet(File stylesheet)
Set the stylesheet file.

Parameters: stylesheet a File value

Throws: Exception on error

setStylesheet

public void setStylesheet(Resource stylesheet)
Set the stylesheet file.

Parameters: stylesheet a {@link org.apache.tools.ant.types.Resource} value

Throws: Exception on error

setURIResolver

public void setURIResolver(URIResolver aResolver)
Set the class to resolve URIs during the transformation

Parameters: aResolver a EntityResolver value

transform

public void transform(File infile, File outfile)
Transform an input file.

Parameters: infile the file to transform outfile the result file

Throws: Exception on error

warning

public void warning(TransformerException e)
Log a warning.

Parameters: e the exception to log.