Altering URLs using value-of-select
This is an open discussion with 6 replies, filed under Troubleshooting.
Search
Yep.
Here you go, try this…
<img src="{$root}/image/2/150/150/5/images/good-music/{photos/item/picture/filename}" />
Anytime you call a value-of select item inside of a html attribute like alt=""
or src=""
you need to use the curly braces {}
.
MAGIC! XSLT just blows my freaking mind…huge thanks, Brian!
If you need to do more complex transformations (say calling templates) that you want to use in an attribute you can also set attributes thusly:
<img> <xsl:attribute name="src"> <xsl:call-template "magic-transformer-template"> <xsl:with-param name="param" select="node" /> </xsl:call-template> </xsl:attribute> </img>
@Makensound - I am a noob (i.e. I don’t fully understand your comment yet), but I appreciate the foresight and I am sure you have answered a future question : ] Thanks man!
@ashrimplin - If you haven’t already done so, run through this little tutorial on W3Schools site.
Yo Brian, thanks man, I went through that tutorial and took down some notes. Like you said, the more you discover about XSLT, you realize the endless possibilities : ]
Create an account or sign in to comment.
Hey all,
I am currently using the JIT image manipulation extension (very cool, btw), and I am trying to see if I can make somewhat of a hybrid URL to jive with my XML. Specifically, I am trying to change:
to
I’ve tried different permutations, but still no success. Any words of wisdom? Thanks!
Adam