views:

28

answers:

1

Hi. I want to create an xsl file (for a xslt transformation to xsl:fo using an xml) How can I display a image whose url is stored in the xml file? I can use variables

<fo:block-container top="5mm" height="20mm" left="0mm" width="75mm">
      <fo:block margin-top="10mm" margin-left="50mm">
        <fo:external-graphic display-align="center" src="url('{$imageUrl}')" content-width="75mm"></fo:external-graphic>
      </fo:block>
    </fo:block-container>

But how can I set the variable's value from a tag from the xml file?

A: 

You can replace {$imageUrl} with {/doc/image/i}.

  <fo:block-container top="5mm" height="20mm" left="0mm" width="75mm">
    <fo:block margin-top="10mm" margin-left="50mm">
      <fo:external-graphic display-align="center" src="url('{/doc/image/i}')" content-width="75mm"></fo:external-graphic>
    </fo:block>
  </fo:block-container>
DevNull