translate a pattern in xslt
i am using XSLT 1.0 version and got st开发者_C百科uck in translating a pattern. I need to translate string 'nn'
with 'XZ'
. Translate function is not working for me. Please suggest how this can be achieved in XSLT 1.0 version without writing seprate template for it in one liner.
You can achieve this using recursive template: embedding tags in xslt
You can use string-before()
and string-after()
to achieve your goal:
<xsl:variable name="prefix" select="substring-before($value, 'nn')" />
<xsl:variable name="suffix" select="substring-after($value, 'nn')" />
<xsl:value-of select="concat($prefix, 'XZ', $suffix)" />
精彩评论