Re: [xsl] Taking string out from the long string

Subject: Re: [xsl] Taking string out from the long string
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Fri, 26 Jul 2002 16:28:45 +0200
http://www.w3.org/TR/xslt#attribute-value-templates

Regards,

Joerg


ashu t wrote:
Thanks a lot . it is working.I have a question but before coming to that i must say that jarno was very right in pointing out that it was very dirty written message indeed.When i read that message later I realised that how dirty it was in just one sentence with all small letters.

And now come to the question:

i am using this style sheet :
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:variable name="alt" select="@alt"/> * this i have declared a global variable*


Then template match for img tag :

  <xsl:template match="img">
    <xsl:variable name="alt" select="@alt"/>
    <xsl:call-template name="filename1">
      <xsl:with-param name="currentstring1" select="@src"/>
   </xsl:call-template>
   </xsl:template>

<!-- Named recursive template -->

   <xsl:template name="filename1">
   <xsl:param name="currentstring1"/>
    <xsl:choose>
     <xsl:when test="contains($currentstring1,'/')">

<!-- There are more folders to be removed, so recurse -->

<xsl:call-template name="filename1">
<xsl:with-param name="currentstring1" select="substring-after($currentstring1,'/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<img alt="{@alt}" src="{concat('./ImageStore/',{concat(substring-before($currentstring1,'.'),'.wbmp')})}"/>


     </xsl:otherwise>
    </xsl:choose>
   </xsl:template>

My folder name is ImageStore where i have stored the converted(.wbmp) images so i want to give the path to my folder image in src.
the problem is that when i am using concat like {concat( then folder and other concat) to concat the './ImageStore/ with the image file name in{concat.....} it is giving error that
Sablotron error on line 355: token '{' not recognized in <b>/usr/local/apache/htdocs/ashu/transform2.php


So i have written src="{concat('./ImageStore/',(concat(substring-before($currentstring,'.'),'.wbmp')))}"

it is working.
What i want to know is that can we use more { and } in src or only one {and } is allowed in any string like src.If yes then what is the method ?
ashu


--

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread