tags:

views:

49

answers:

2

Hi ,

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.Xsl.XsltException: Cannot find the script or external object that implements prefix 'fn'

Can anybody tell me what is the issue.

Thanks in advance Pradeep

+2  A: 

You can use this instead:

<xsl:value-of select="translate(string, ',', '.')" />
True Soft
+2  A: 

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.

eddiegroves
If you want to use XSLT and XPath 2.0 with the Microsoft .NET framework then you can consider using the .NET version of Saxon 9 from http://saxon.sourceforge.net/.
Martin Honnen