Hello, I'm struggling with an image mechanism I'm trying to build
which basically manipulates a URL string.
This is the sort URL that is gained from an InfoPath form
https://xxx-xxx.xxx.xxx.com/content/...xx/xxx/xxx.jpg
However I need to manipulate it so it also displays like this;
https://xxx-xxx.xxx.xxx.com/content/..._t/xxx_JPG.jpg
As you can see it adds an '_t' and a '_JPG' into the URL string.
This is where I am up to now, which from what I can see adds a '_' in
front of the URL.
_______________ _______________ _______________ _______________ _______________ ___________
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:variable name="url" select="my:myFi elds/my:URL"/>
<xsl:call-template name="truncate" >
<xsl:with-param name="string" select="$url"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="truncate" >
<xsl:param name="string"/>
<xsl:param name="counter" select="3"/>
<xsl:if test="$string!= '' and $counter!=0">
<xsl:text>_</xsl:text>
<xsl:choose>
<xsl:when test="contains( $string, ' ')">
<xsl:value-of select="substri ng-before($string, '/')"/>
<xsl:call-template name="truncate" >
<xsl:with-param name="string" select="substri ng-
after($string, '/')"/>
<xsl:with-param name="counter" select="$counte r - 1"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwis e>
<xsl:value-of select="$string "/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
_______________ _______________ _______________ _______________ _______________ _______________
Please advise or show me some useful code.
Many thanks in advance