Synopsis

This simple transformer that can be useful for debugging any XML pipeline. It saves as a regular XML file, the SAX stream it receives. In this way we can save a snapshot of any given step of a XML pipeline.

There are other alternatives for this purpose, like these ones:

Usage

Here is the component declaration:

<map:transformer name="foto" src="fcc.ima.cocoon.FotoTransformer"/>

And its a sample usage in a pipeline:

<map:generate src="my-source.xml"/>
<map:transform src="my-stylesheet1.xsl"/>
<map:transform type='foto' src='snapshots/snapshot1.xml'/>
<map:transform src="my-stylesheet2.xsl"/>
<map:transform type='foto' src='snapshots/snapshot2.xml'/>
<map:serialize type='html'/>

As you can see you name the output file through the src attribute. It supports any URI scheme supported by Cocoon

Source code

It is included in the attachments.

Attachment: MiXMLPipe.java

Attachment: FotoTransformer.java