开发者

xslt replace function

开发者 https://www.devze.com 2023-01-07 08:12 出处:网络
I am using fn:replace(string,pattern,replace) function to replace \',\' to \'.\'. URI i used for the function is http://www.w3.org/2005/xpath-functions. But i m getting an exception saying

I am using fn:replace(string,pattern,replace) function to replace ',' to '.'. URI i used for the function is http://www.w3.org/2005/xpath-functions. But i m getting an exception saying

System.Xml.X开发者_如何学Csl.XsltException: Cannot find the script or external object that implements prefix 'fn'

Can anybody tell me what is the issue.

Thanks in advance Pradeep


You can use this instead:

<xsl:value-of select="translate(string, ',', '.')" />


The .net framework implements XSLT 1.0 only, and the new functions such as replace are in the XPath 2.0 and XQuery 1.0 Functions and Operators spec which is not supported.

You will have to make do with translate or a hack such as described here.

0

精彩评论

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