You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Laurent BERTHELOT <la...@studioblanc.fr> on 2004/03/12 11:00:48 UTC

[beginner] Component READ ang img

Hello,

(sorry for my poor english)

I have a problem concerning reader component.

I have a sitemap (on mysite dir) with component declaration :

    <map:components>
        <map:readers default="resource" src="org.apache.cocoon.reading.ResourceReader"/>
    </map:components>

And a read declaration into the pipeline :

    <!-- Img directory -->
    <map:match pattern="**.jpg">
        <map:read mime-type="image/jpg" src="{1}.jpg"/>
    </map:match>

That's work ! I can display a jpg on http://localhost/mysite/myjpg.jpg

I use xslt and FO for create PDF on-the-fly.
I have test.xml, and text2pdf.xsl in the same directory of my jpeg.
PDF creation work except "external-graphic"

I have on my XSL :

  <xsl:template match="img">
     <fo:block text-align="center">
      <fo:external-graphic src="myjpg.jpg"/>
    </fo:block>
  </xsl:template>

But the link is not resolving... (none image on my PDF)

When i test with absolute link :

  <xsl:template match="img">
     <fo:block text-align="center">
      <fo:external-graphic src="http://localhost/mysite/myjpg.jpg"/>
    </fo:block>
  </xsl:template>

It work.

Can you help me ?
I want use relative link...

Thanks.

Laurent BERTHELOT

RE: [beginner] Component READ ang img

Posted by Matthew Langham <ml...@s-und-n.de>.
Hi Laurent,

this is an error in FOP if I remember correctly. We had the same problem and
had to use absolute links.

Matthew
  -----Original Message-----
  From: Laurent BERTHELOT [mailto:laurent.berthelot@studioblanc.fr]
  Sent: Friday, March 12, 2004 11:01 AM
  To: users@cocoon.apache.org
  Subject: [beginner] Component READ ang img


  Hello,

  (sorry for my poor english)

  I have a problem concerning reader component.

  I have a sitemap (on mysite dir) with component declaration :

      <map:components>
          <map:readers default="resource"
src="org.apache.cocoon.reading.ResourceReader"/>
      </map:components>

  And a read declaration into the pipeline :

      <!-- Img directory -->
      <map:match pattern="**.jpg">
          <map:read mime-type="image/jpg" src="{1}.jpg"/>
      </map:match>

  That's work ! I can display a jpg on http://localhost/mysite/myjpg.jpg

  I use xslt and FO for create PDF on-the-fly.
  I have test.xml, and text2pdf.xsl in the same directory of my jpeg.
  PDF creation work except "external-graphic"

  I have on my XSL :

    <xsl:template match="img">
       <fo:block text-align="center">
        <fo:external-graphic src="myjpg.jpg"/>
      </fo:block>
    </xsl:template>

  But the link is not resolving... (none image on my PDF)

  When i test with absolute link :

    <xsl:template match="img">
       <fo:block text-align="center">
        <fo:external-graphic src="http://localhost/mysite/myjpg.jpg"/>
      </fo:block>
    </xsl:template>

  It work.

  Can you help me ?
  I want use relative link...

  Thanks.

  Laurent BERTHELOT