Subject:.JPG Filename Initialization in XSLT from XML tag Author:Mary Johnson Date:10 Nov 2005 07:19 PM
I am embarrased to say that I spent over 8 hours on the Internet today researching this topic and I am crying "Uncle!". Please, someone tell me if it is even possible to do what I want to do.
In my XSLT, I want to display a .jpg image whose filename is specified in an XML file.
I don't know the syntax for inserting the tag reference within the
<img src="xxxxxxxxxx"> HTML code.
I have tried the obvious (to me) following options, to no avail:
Subject:.JPG Filename Initialization in XSLT from XML tag Author:Minollo I. Date:10 Nov 2005 08:59 PM
What is PictureID? An element? An attribute? A variable/parameter?
And what is the XSLT context in which that output is created?
The syntax you are trying to use is an attribute template; assuming that this outputs the value you want:
<xsl:value-of select="PictureID"/>
...then this one would create the src attribute you are looking for:
<img src="{PictureID}"/>
What you type in between "{}" is resolved as an XPath expression... but I'm missing the answers to the questions above to be able to understand if the XPath expression "PictureID" is what is needed in your specific context.
Subject:.JPG Filename Initialization in XSLT from XML tag Author:Mary Johnson Date:11 Nov 2005 09:04 AM
Thank you, everyone. Your responses gave me encouragement that it was possible and focused me to look more carefully at the XML and try another option and it is now working.
My problem was that I didn't understand that I had to fully qualify my path to my XML tag. I thought that I could just use the final element name. See below: