xsl-list
[Top] [All Lists]

Re: using traslate function to replace strings

2004-08-06 15:16:56
"${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