You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Markus Alin <ma...@swissrisk.com> on 2003/06/10 15:52:34 UTC

Using dynamic SVG with FOP

Hi All!!

We are currently building a reporting application featuring PDF
generation with FOP. Within the FOP we call a url generating a jpeg
image by transforming a XML into a SVG and by serializing this into a
jpeg. This works perfectly for static jpegs but by the start of the jpeg
matcher the application does not seem to have a session and therefore no
XML can be generated (we user readDOMSession transformers). This
ofcourse works perfectly when calling the jpeg pipeline stand alone but
it does not work when calling it from inside the XSLT stylesheet
generating the FOP.

Any ideas how to solve this???

The calling code and the jpeg matcher is attached below!! 

Best regards, Markus


<!-- Calling code -->
<!-- SVG Products JPG -->
<xsl:variable name="hostname" select="//serverinfo/hostname"/>
<xsl:variable name="port" select="//serverinfo/port"/>
<xsl:variable name="rootmount" select="//serverinfo/rootmount"/>
<xsl:variable name="base_url"
select="concat('http://',$hostname,':',$port,'/',$rootmount,'/')"/>
<fo:block text-align="start" line-height="11px" font-size="9px"
font-family="Arial, sans-serif" color="#000000" font-weight="bold">
   Products
   <fo:external-graphic
src="{$base_url}advisory/allocation/alloc_products.jpg" width="80mm"
border="0"/>
</fo:block>

	<!-- Sitemap matcher -->
      <map:match pattern="**/allocation/*.jpg">
        <map:act type="set-header">
          <map:parameter name="Pragma" value="no-cache"/>
          <map:parameter name="Cache-Control" value="no-cache"/>
          <map:parameter name="Expires" value="-1"/>
          <map:parameter name="Last-Modified" value="Thu, 25 Apr 1997
18:40:00 GMT"/>
        </map:act>
        <!--<map:generate src="resources/xml/empty.xml"/>-->
        <map:generate src="cocoon://datasources/viewsession2.xsp"/>
        <map:transform type="readDOMsession" label="debug1">
          <map:parameter name="dom-name" value="allocRecord"/>
          <map:parameter name="trigger-element"
value="allocation-record"/>
          <map:parameter name="position" value="in"/>
        </map:transform>
        <map:transform type="readDOMsession" label="debug2">
          <map:parameter name="dom-name" value="Result"/>
          <map:parameter name="trigger-element" value="page"/>
          <map:parameter name="position" value="in"/>
        </map:transform>
        <map:transform type="readDOMsession" label="debug3">
          <map:parameter name="dom-name" value="rdata"/>
          <map:parameter name="trigger-element" value="page"/>
          <map:parameter name="position" value="in"/>
        </map:transform>
        <map:transform
src="branches/{session:I_branch}/stylesheets/{1}/allocation/{2}-svg.xsl"
label="debug4"/>
        <map:transform type="CSSSVGTransformer" label="debug5">
            <map:parameter name="css-url"
value="cocoon:/svg_alloc.css"/>
        </map:transform>
        <map:serialize type="svg2jpeg"/>
      </map:match>


===============================================
Markus Alin         tel: +41 1 455 70 03
Swissrisk AG        fax: +41 1 455 70 01
Räffelstrasse 32    mailto:markus@swissrisk.com
8045 Zürich         www.swissrisk.com
===============================================


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


Re: Using dynamic SVG with FOP

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Markus Alin wrote:
> We are currently building a reporting application featuring PDF
> generation with FOP. Within the FOP we call a url generating a jpeg
> image by transforming a XML into a SVG and by serializing this into a
> jpeg. This works perfectly for static jpegs but by the start of the jpeg
> matcher the application does not seem to have a session and therefore no
> XML can be generated (we user readDOMSession transformers).

You can try to embed the dynamic SVGs directly into the
FO as fo:instream-foreign-object. Use aggregation or
XInclude to get the data into the pipeline.

J.Pietschmann


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