开发者

translate a pattern in xslt

开发者 https://www.devze.com 2023-03-11 20:33 出处:网络
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

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)" />
0

精彩评论

暂无评论...
验证码 换一张
取 消