translate 函数
2007/8/3 21:39:54
阅读全文(3116) | 回复(1) | 编辑 | 精华
translate 函数 返回第一个参数字符串,出现第二个参数字符串中的字符的位置替换为第三个参数字符串中对应位置的字符。 string translate(string, string, string) 500)this.width=500'>XSLT 文件 (translate.xsl) Xml 500)this.width=500'> 复制代码<?xml version='1.0'?> <?xml-stylesheet type="text/xsl" href="translate.xsl"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> translate("bar","abc","ABC") = <xsl:value-of select='translate("bar","abc","ABC")'/> <br/>translate("--aaa--","abc-","ABC") = <xsl:value-of select='translate("--aaa--","abc-","ABC")'/> </xsl:template> </xsl:stylesheet> 格式化输出 translate("bar","abc","ABC") = BAr translate("--aaa--","abc-","ABC") = AAA 处理器输出 Xml <?xml version="1.0" encoding="UTF-16"?> translate("bar","abc","ABC") = BAr<br />translate("--aaa--","abc-","ABC") = AAA
Posted by Qr on 2007/8/3 21:39:54
回复:translate 函数
2007/10/11 17:07:17
个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除
怎么用translate实现单词的第一个字母的大小写呢?难道要substring后再实现? 以下为blog主人的回复: 目前没有想到更好的办法。如果你或别人想到,希望告诉我一声,这个问题我也想了解。
loveover(游客)
Posted by loveover(游客) on 2007/10/11 17:07:17
发表评论: |