Transforming Data

XSL Transformations

The xslTransform activity allows you to transform an XML document into a text document of any format. For example, you can transform the WebRowSet output from an SQL query into an HTML page to be viewed with a browser.

  1. An example of an XSLT document can be found here. This XSLT document transforms WebRowSet format into a HTML table. You can load the file into a string using the FileUtilities class:
  2. Create an SQL query whose output will be connected to the input to the transform activity.
    SQLQuery query =
      new SQLQuery("select * from littleblackbook where id<=1000");
    
  3. Construct an XSLTransform object (corresponding to the xslTransform activity) and set its XML input field to the output of your SQL query.
    XSLTransform transform = new XSLTransform();
    transform.setXMLInput( query.getOutput() );
    transform.setXSLTInput( xslt );
    
  4. Save the results to a file and view it with a browser.

See examples/tutorials/clienttoolkit/XSLTransformExample.java and examples/tutorials/clienttoolkit/XSLTransformWithDelivery.java.

ZIP and GZIP Compression

The gzipCompression activity compresses data from another activity producing the data in GZIPped form and also metadata about the compression. It has one input (data to be compressed) and two outputs (GZIPped data and metadata).

The zipArchive activity archives data from other activities producing a ZIP archive and also metadata about the compression. It has one or more inputs and two outputs.