[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: using traslate function to replace strings
From: "Marina Cuello" <cuello@xxxxxxxxxxxxxx>
Date: Fri, 6 Aug 2004 19:16:56 -0300
> "${VITRIA}" to "dependency". The following code is
> changing "${VITRIA}" to "dependenc".

I think "translate" make a "one to one" translation, each character in the
second parameter is changed to the counterpart on the third parameter, and
that's why you get the last "y" cut.

If you Know there would be only one "${VITRIA}" in each of the strings you
need to translate, you could try something like this:

<xsl:variable name="cutB" select="substring-before(@VALUE,'${VITRIA}')"/>
<xsl:variable name="cutA" select="substring-after(@VALUE,'${VITRIA}')"/>
.
.
.
<xsl:attribute name="VALUE">
                <xsl:value-of select="concat($cutA,'dependency'.$cutB)"/>
</xsl:attribute>

If there is more than one, I don't have experience enought to be sure, but
perhaps you can make a recursive template to achieve it.

Marina

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member