Search

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:

<img src="{$root}/image/2/150/150/5/images/good-music/cover.jpg" />

to

<img src="{$root}/image/2/150/150/5/images/good-music/<xsl:value-of select="photos/item/picture/filename" />" />

I’ve tried different permutations, but still no success. Any words of wisdom? Thanks!

Adam

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.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details