cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John E. Conlon" <jcon...@verticon.com>
Subject How to Combine Streaming Transforms with external TransformerHandler filters?
Date Fri, 24 Oct 2003 16:21:11 GMT
Hi,

I am a new user of Cocoon and noticed a STX implementation in the blocks
samples page of the Cocoon 2.1.2.  This got me to thinking about using
hybrid STX in combination with XSLT and SAX transformations within
Cocoon.

For me these hybrid transformations are one of the most interesting
featuresfor using STX because I will be working with large files for
ETL. 


STX style sheets can call external filters implemented as
javax.xml.transform.sax.TransformerHandler objects via uri references.
To inform the transformer of these one must add a
net.sf.joost.TransformerHandlerResolver object to the the STX
transformer (called JOOST in Java).  The TransformerHandlerResolver maps
STX stylesheet uris to appropriate TransformHandler objects.

Since JOOST is TrAX enabled it is simply a matter of adding an attribute
to the TRAX TansformerFactory. In Java using TrAX it is easy to do this
with

// register the resolver
         factory.setAttribute(
          "http://joost.sf.net/attributes/transformer-handler-resolver",
           filter
          );

I have seen the conf for JOOST in the Cocoon it looks like this.

<xmap xpath="/sitemap/components/transformers"
unless="transformer[@name='stx']">
    <map:transformer name="stx"
                     logger="sitemap.transformer.stx"
                    
src="org.apache.cocoon.transformation.TraxTransformer">
       
<transformer-factory>net.sf.joost.trax.TransformerFactoryImpl</transformer-factory>
    </map:transformer>
</xmap>

Question?
But how do I set up a TrAX transformer in cocoon and specify an object 
like
TransformHandlerResolver as an attribute?


For details on STX/XSLT/SAX hybrid transforms see:
http://www.informatik.hu-berlin.de/~obecker/Docs/EML2003/

cheers,
John


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message