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

Qr

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

» 1 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)
站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.047 second(s), page refreshed 144757464 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号