You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by Matt Sergeant <ma...@sergeant.org> on 2003/02/19 16:54:12 UTC

Streaming Transformations for XML (STX) and Cocoon (fwd)

Interesting...

-- 
<!-- Matt -->
<:->get a SMart net</:->
Spam trap - do not mail: spam-sig@spamtrap.messagelabs.com

---------- Forwarded message ----------
Date: Wed, 19 Feb 2003 15:25:45 +0100
From: Daniel Fagerstrom <da...@nada.kth.se>
Reply-To: "cocoon-dev@xml.apache.org" <co...@xml.apache.org>
To: "cocoon-dev@xml.apache.org" <co...@xml.apache.org>
Subject: Streaming Transformations for XML (STX) and Cocoon

I have done some initial experiments using STX (Streaming
Transformations for XML see: http://stx.sourceforge.net/ ) together with
Cocoon and this far it seem to work well.

STX is similar to XSLT but the transformation rules reacts on events
(SAX) instead of matching on a tree model as XSLT. This means that an
STX processor doesn't have to store all the input data as an XSLT
processor normally does (this could in principle be done in special
cases for XSLT also, but it has been discussed on the Xalan-dev list and
it seem to be very complicated to do in pracice ). Sylvain and Vadim
seemed entusiastic about STX some while ago
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=101613150500829&w=2.

There is a Java implementation of STX called Joost
http://joost.sourceforge.net/ that implements the TrAX interfaces. To
use it you just need joost.jar and log4j.jar (Joost has excplicit
references to log4j everywhere in the code :( ). And as it implements
TrAX the TraxTRansformer can be used as is, just put something like:

<map:transformer name="stx" pool-grow="2" pool-max="32" pool-min="8"

                  src="org.apache.cocoon.transformation.TraxTransformer">
   <use-request-parameters>false</use-request-parameters>
   <use-browser-capabilities-db>false</use-browser-capabilities-db>
<transformer-factory>net.sf.joost.trax.TransformerFactoryImpl</transformer-factory>
</map:transformer>

in the component section in the sitemap and then you can use it in the
pipelines, e.g.

<map:match pattern="*.html">
   <map:generate src="{1}.xml"/>
   <map:transform type="stx" src="{1}.stx"/>
   <map:serialize/>
</map:match>

I have just tried it at some small examples this far and have not done
any benchmarking, but if it is stable enough it should be very usefull
for handling e.g. large data sets from databases, something that can
consume large amounts of memory while processed in Xalan.

/Daniel Fagerstrom



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