We have Multimedia Component that works with external and internal images. When we have external images we have two cases:
External Image that has query string parametes ... ex:
http://yahoo.com/someimage.jpg?param1=1¶m2=2&+_+=.jpg
External Image that has no query string parameters ... ex:
http://yahoo.com/someimage.jpg
In our component template transformation we would like to display the second type the way it is stored, and the first one we would like to be: http://yahoo.com/someimage.jpg?param1=1¶m2=2
The code looks like:
<xsl:if test="document(@xlink:href)/tcm:Component/tcm:Data/tcm:IsExternalMultimediaFile = 'true' and contains(document(@xlink:href)/tcm:Component/tcm:Data/tcm:MultimediaFilename, '&+_+=') = 'false'">
<xsl:text disable-output-escaping="yes"><![CDATA[<Image>]]></xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[<img src="]]></xsl:text>
<xsl:value-of select="document(@xlink:href)/tcm:Component/tcm:Data/tcm:MultimediaFilename" />
<xsl:text disable-output-escaping="yes"><![CDATA[" alt="]]></xsl:text>
<xsl:value-of select="@xlink:title" />
<xsl:text disable-output-escaping="yes"><![CDATA[" />]]></xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[</Image>]]></xsl:text>
</xsl:if>
<xsl:if test="document(@xlink:href)/tcm:Component/tcm:Data/tcm:IsExternalMultimediaFile = 'true' and contains(document(@xlink:href)/tcm:Component/tcm:Data/tcm:MultimediaFilename, '&+_+=') = 'true'">
<xsl:text disable-output-escaping="yes"><![CDATA[<Image>]]></xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[<img src="]]></xsl:text>
<xsl:value-of select="substring-before(document(@xlink:href)/tcm:Component/tcm:Data/tcm:MultimediaFilename, '&+_+=')" />
<xsl:text disable-output-escaping="yes"><![CDATA[" alt="]]></xsl:text>
<xsl:value-of select="@xlink:title" />
<xsl:text disable-output-escaping="yes"><![CDATA[" />]]></xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[</Image>]]></xsl:text>
</xsl:if>
For some reason both the cases get executed. Can someone help? The solution is probably only a error in the if but I am not sure where...