On Mon, 13 Sep 2004 23:27:34 +0200
Joerg Heinicke <[EMAIL PROTECTED]> wrote:


> It seems to be heavy to do this transformation multiple times though
> you need to do it only once using the FragmentExtractorTransformer.
> Could help to reduce the memory needs.

Well, after looking for some docs, it's of course  the most elegant
method, but less documented for this beautiful solution. 




>From reading the source here a example for Lincoln:
In the sitemap or subsitemap:
inside the map:component-section/map:transformars
<map:transformer name="wordimgextractor"
   src="org.apache.cocoon.transformation.FragmentExtractorTransformer"
   logger="sitemap.transformer.extractor">      
 <extract-uri>http://schemas.microsoft.com/office/word/2003/wordml</extr
act-uri>      
 <extract-element>pict</extract-element>  
</map:transformer>


the wordml2html-pipeline
   <map:match pattern=".....">
     <map:generate src="..."/>
     <map:transform type="wordimgextractor"/>
     <map:transform src="wordml2html"/>
     <map:serialize type="html"/>
   </map:match>

This will remove all w:pict-elements from the wordml-document and store
it inside the cocoon-cache  and instead of the pict-elements you will
get something like:
<fe:fragment xmlns:fe="http://apache.org/cocoon/fragmentextractor/2.0";
fragment-id="8b5dcbaa795d39f5"/>
with this fragment-id you can query (as ImageID for the next pipeline)
the stored image-data like

<map:match pattern="*.jpg">
        <map:generate type="extractor" src="{1}"/>
        <map:transform src="stylesheets/wordml2svg.xsl">
                <map:parameter name="image" value="{1}"/>
        </map:transform>
        <map:serialize type="svg2jpeg"/>
</map:match>

where you get the w:pict-element back from the cocoon-cache and only
this, so there is no more the whole wordml-document as DOM in the
memory (with all the other images) like Joerg pointed out.


In any cases (448MB or 2GB)  this will spare your(Lincoln's) memory.


Best Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to