[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: 3 Questions about FOP.

Subject: RE: 3 Questions about FOP.
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Mon, 08 Oct 2001 10:07:38 +0200
fop external graphic cocoon
Joshua.Kuswadi@xxxxxxxxxxxxxxxxxxxx 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.