Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to put a variable in XSL-FO?

Status
Not open for further replies.

SilverStray

Programmer
Joined
Oct 25, 2001
Messages
47
Location
AU
I have the following line of code to put an image in
XSL-FO.

<fo:block>
<fo:external-graphic src="url('.\images\SOIC.bmp')"/>
</fo:block>

How can I make the image portion into a variable where
value should be whatever is given in the XML for the
same directory?


Please help.


thanks in advance.
Joni
 
I think the following is more or less what you need to do - obviously all the names are changeable with something appropriate to the rest of your file

<xsl:template match="ImageSOIC" name="DisplayImage">
<xsl:variable name="Picture" select="ItemList\PictureName"/>
<fo:block>
<fo:external-graphic src="$Picture"/>
</fo:block>
</xsl:template>

in you XML you have something like
<ItemList>
<Picturename>SOIC.bmp</Picturename>
</ItemList>

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top