Re: [xsl] Figure Problem using XSL-FO

Subject: Re: [xsl] Figure Problem using XSL-FO
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 16 Oct 2006 09:46:17 -0400
At 2006-10-16 14:10 +0100, David Carlisle wrote:
> I have one problem. I am creating XML to PDF. I want ignore second
> imageobject

just select the first, something like:

   <fo:block line-height="1.5"
xsl:use-attribute-sets="formal.object.properties" text-align="center">
 <fo:external-graphic src="@fileref">

Actually when using an attribute specification, it would need an attribute value template, and the use of url(), and I tell my students to use double quotes inside the attribute to protect from URI strings that validly have single quotes, so I would suggest:

<fo:external-graphic src="url(&quot;{@fileref}&quot;)"/>

  <xsl:attribute name="src">
                <xsl:apply-templates select="imagedata[@format='GIF' or
@format='JPG'][1]/@fileref"/>

There is no need for *both* the src= specification and the attribute instruction.

If you were to choose to use the instruction,
then it would be along the lines of:

  <xsl:attribute name="src">
    <xsl:text>url("</xsl:text>
    <xsl:apply-templates select="imagedata[@format='GIF' or
                                 @format='JPG'][1]/@fileref"/>
    <xsl:text>")</xsl:text>
  </xsl:attribute>

But it would be one or the other, and not both.

I hope this helps.

. . . . . . . . . . Ken




-- UBL/XSLT/XSL-FO training: Allerxd/Verx Denmark 2006-11-13,17,20/24 UBL International 2006 2006-11-13/17 http://www.ublconference.com World-wide corporate, govt. & user group UBL, XSL, & XML training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread