Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2004, 01:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default xsl:fo with Select

Hi!

I have this line in my xsl which functions:

<fo:block><fo:external-graphic src='pict\thing.bmp'/></fo:block>

However, I'm to make this work inside a for-each element. The source element have the name of the picture as an attribute like this:

<para picture="pict\thing.bmp">

So what I want is immediatly after selecting the para element value, I want to select a picture based on the attribute using 'value-of select="@picture"'.

But I just can't make it work.

Can anyone help me with the syntax for using the 'value-of' in the 'fo:external-graphic' line?

Or any other solution!

(I'm using FOP to generate pdf)

Thanks in advance.
 
Old September 6th, 2004, 02:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think this works! Gotta have a closer look on it!

<xsl:element name="fo:external-graphic">
<xsl:attribute name="src">url('<xsl:value-of select="@picture"/>')
</xsl:attribute>
</xsl:element>
 
Old September 7th, 2004, 01:51 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Code:
<fo:block><fo:external-graphic src="{@picture}"/></fo:block>
or, based on your second post
Code:
<fo:block><fo:external-graphic src="url('{@picture}')"/></fo:block>
In this situation anything within the {} is evaluated as an XPath expression.


--

Joe (Co-author Beginning XML, 3rd edition)
 
Old September 7th, 2004, 09:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, but I can't make your examples work in my code - but I'll work on it. It could be other elements in my code that disturbs your solution. The code I found with the element works, so until I have a better grasp of the subject, I'll stick to that!

But thanks anyway, Joe!

I guess must have a better grasp of it now, cause it works! Thanks!
 
Old July 18th, 2006, 11:38 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi All,

I want to include a GIF into a PDF, which is there in Websever location (/nova/global/images).

Following bits of code is implemented on both webpshere 5.0.1 and 6.0.0.1, images are displaying in webpshere 5.0.1 and but not in webpshere 6.0.0.1.

<fo:block text-align="right" font-weight="bold" padding="10pt">
    <fo:external-graphic src="url('{$domain}/nova/global/images/nissan-logo.gif')" />
</fo:block>

and

<fo:external-graphic>
 <xsl:attribute name="src">url('<xsl:value-of select="$domain"/><xsl:value-of select="/page/generic/NSC-MODEL-XTND/NSC-MODEL-XTND-EBROCHURE-IMAGE" />')</xsl:attribute>
</fo:external-graphic>

In the above code, value of domain is comming from XML (value is http://prepodweb1.xxxxx.co.uk) and value for /page/generic/NSC-MODEL-XTND/NSC-MODEL-XTND-EBROCHURE-IMAGE is /Media-Library/vehicles/e-brochure/br-micramc2005.jpg

Is there any issue with Webpshere 6.0.0.1.

It would be extremely helpful for any suggestions.

Thanks & Regards,
Deva

Quote:
quote:Originally posted by Birger
 Hi!

I have this line in my xsl which functions:

<fo:block><fo:external-graphic src='pict\thing.bmp'/></fo:block>

However, I'm to make this work inside a for-each element. The source element have the name of the picture as an attribute like this:

<para picture="pict\thing.bmp">

So what I want is immediatly after selecting the para element value, I want to select a picture based on the attribute using 'value-of select="@picture"'.

But I just can't make it work.

Can anyone help me with the syntax for using the 'value-of' in the 'fo:external-graphic' line?

Or any other solution!

(I'm using FOP to generate pdf)

Thanks in advance.






Similar Threads
Thread Thread Starter Forum Replies Last Post
xHTML to XSL:FO to PDF NotesSensei XSLT 0 September 2nd, 2006 10:02 AM
RDF, OWL and XSL-FO NEO1976 XSLT 6 August 23rd, 2006 04:23 AM
XSL-FO NEO1976 XML 2 July 19th, 2006 10:10 AM
XSL-FO Question gray XSLT 1 February 18th, 2005 11:31 AM
hello, some problems with XSL-FO LuisMM XSLT 4 December 19th, 2003 02:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.