org.apache.tools.ant.taskdefs.optional
Class TraXLiaison

java.lang.Object
  |
  +--org.apache.tools.ant.taskdefs.optional.TraXLiaison
All Implemented Interfaces:
javax.xml.transform.ErrorListener, XSLTLiaison, XSLTLiaison2, XSLTLoggerAware

public class TraXLiaison
extends java.lang.Object
implements XSLTLiaison2, 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.XSLTLiaison
FILE_PROTOCOL_PREFIX
 
Constructor Summary
TraXLiaison()
           
 
Method Summary
 void addParam(java.lang.String name, java.lang.String value)
          Add a parameter to be set during the XSL transformation.
 void configure(XSLTProcess xsltTask)
          Specific configuration for the TRaX liaison.
 void error(javax.xml.transform.TransformerException e)
           
 void fatalError(javax.xml.transform.TransformerException e)
           
protected  java.lang.String getSystemId(java.io.File file)
          Deprecated. use org.apache.tools.ant.util.JAXPUtils#getSystemId instead
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set a custom attribute for the JAXP factory implementation.
 void setEntityResolver(org.xml.sax.EntityResolver aResolver)
          Set the class to resolve entities during the transformation
 void setFactory(java.lang.String name)
          Set the factory name to use instead of JAXP default lookup.
 void setLogger(XSLTLogger l)
           
 void setOutputProperty(java.lang.String name, java.lang.String value)
          Set the output property for the current transformer.
 void setStylesheet(java.io.File stylesheet)
          set the stylesheet to use for the transformation.
 void setURIResolver(javax.xml.transform.URIResolver aResolver)
          Set the class to resolve URIs during the transformation
 void transform(java.io.File infile, java.io.File outfile)
          Perform the transformation of a file into another.
 void warning(javax.xml.transform.TransformerException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TraXLiaison

public TraXLiaison()
            throws java.lang.Exception
Method Detail

setStylesheet

public void setStylesheet(java.io.File stylesheet)
                   throws java.lang.Exception
Description copied from interface: XSLTLiaison
set the stylesheet to use for the transformation.

Specified by:
setStylesheet in interface XSLTLiaison
Parameters:
stylesheet - the stylesheet to be used for transformation.
Throws:
java.lang.Exception - thrown if any problems happens.

transform

public void transform(java.io.File infile,
                      java.io.File outfile)
               throws java.lang.Exception
Description copied from interface: XSLTLiaison
Perform the transformation of a file into another.

Specified by:
transform in interface XSLTLiaison
Parameters:
infile - the input file, probably an XML one. :-)
outfile - the output file resulting from the transformation
Throws:
java.lang.Exception - thrown if any problems happens.
See Also:
XSLTLiaison.setStylesheet(File)

setFactory

public 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

setAttribute

public 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

setOutputProperty

public 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

setEntityResolver

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


setURIResolver

public void setURIResolver(javax.xml.transform.URIResolver aResolver)
Set the class to resolve URIs during the transformation


addParam

public void addParam(java.lang.String name,
                     java.lang.String value)
Description copied from interface: XSLTLiaison
Add a parameter to be set during the XSL transformation.

Specified by:
addParam in interface XSLTLiaison
Parameters:
name - the parameter name.
value - the parameter value as an expression string.

setLogger

public void setLogger(XSLTLogger l)
Specified by:
setLogger in interface XSLTLoggerAware

error

public void error(javax.xml.transform.TransformerException e)
Specified by:
error in interface javax.xml.transform.ErrorListener

fatalError

public void fatalError(javax.xml.transform.TransformerException e)
Specified by:
fatalError in interface javax.xml.transform.ErrorListener

warning

public void warning(javax.xml.transform.TransformerException e)
Specified by:
warning in interface javax.xml.transform.ErrorListener

getSystemId

protected java.lang.String getSystemId(java.io.File file)
Deprecated. use org.apache.tools.ant.util.JAXPUtils#getSystemId instead


configure

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

Specified by:
configure in interface XSLTLiaison2
Parameters:
xsltTask - the XSLTProcess task instance from which this liasion is to be configured.


Copyright 2000-2005 Apache Software Foundation. All Rights Reserved.