This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: 3 Questions about FOP.
- To: XSL List <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] 3 Questions about FOP.
- From: Joerg Pietschmann <joerg dot pietschmann at zkb dot ch>
- Date: Mon, 08 Oct 2001 10:07:38 +0200
- Organization: ZKB
- Reply-To: xsl-list at lists dot mulberrytech dot com
Joshua.Kuswadi@BTFinancialgroup.com wrote:
> [Someone else asked]
> > Question 3:
> > The only way I could get a graphic to appear is by using
> > "external-graphic".
> Maybe try:
> <xsl:element name="fo:external-graphic">
> <xsl:attribute name="src">
> http://workstation/cocoon/development/_images/
> <xsl:value-of select="location"/>
> </xsl:attribute>
> <xsl:attribute name="height">100px</xsl:attribute>
> <xsl:attribute name="width">100px</xsl:attribute>
> </fo:external-graphic>
Apart from being illegal XML (look closely), the code above is likely
to fail due to additional whitespace in the value of the src attribute,
It will generate something like src="%0D%20%07...http://...".
The following corrects this and also uses an alternative code style
(literal elements and attribute value templates) in order to gain
some readability:
<fo:external-graphic
src="http://workstation/cocoon/development/_images/{location}"
height="100px"
width="100px"/>
Note also this requires a HTTP server running on host "workstation"
which is able to serve the graphic. If you want to read directly
from the file system, use the file: protocol
src="file://cocoon/development/_images/{location}"
(If this gives errors, try file:/cocoon... or file:///cocoon...,
implementations vary may a bit).
Another point is that measurements should not be given in pixels (px)
in most contexts, you should try millimeters (mm), points (pt) or
something like this first. Pixels are not well defined for PDF output.
HTH
J.Pietschmann
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list