I need to use a string replace function in my XSL document. I found a W3
library that has numerous string functions such as fn:replace(). When I try
using the namespace, I get an error
"Cannot find the script or external object that implements prefix
'http://www.w3.org/2005/02/xpath-functions'.
I am using VB, an XMLDocument object, an XSLCompiledTransform object, and an
XmlTextWriter to store the transformation.
Here is the start of my XSL document:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<xsl:template match="/">
<html>
<body style="margin-left:35;">
...
<xsl:value-of select="fn:replace(//xml/fields/CEADR1, 'abc',
'def')"/><br/>
...
Am I doing something wrong? Is this namespace not compatible with .NET 2.0?
Help!
SR
Martin Honnen - 20 Mar 2007 18:16 GMT
> I need to use a string replace function in my XSL document. I found a W3
> library that has numerous string functions such as fn:replace(). When I try
> using the namespace, I get an error
>
> "Cannot find the script or external object that implements prefix
> 'http://www.w3.org/2005/02/xpath-functions'.
You have probably looked at the XPath 2.0 specification or its working
drafts. The .NET framework class libraries support XSLT and XPath 1.0.
If you want XSLT and XPath 2.0 support then you need to look into Saxon
for .NET from <http://www.saxonica.com>.
You might also want to check EXSLT.NET on
<http://www.codeplex.com/Wiki/View.aspx?ProjectName=MVPXML> as EXSLT has
some powerful string manipulation functions too.

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
SR - 20 Mar 2007 20:02 GMT
Thanks.
I am looking at the XPath 2.0 specs. They came out in 2005. Silly me
thinking that Visual Studio 2005 would have 2005 specs in them...duh.
Thanks again.
>> I need to use a string replace function in my XSL document. I found a W3
>> library that has numerous string functions such as fn:replace(). When I
[quoted text clipped - 11 lines]
> <http://www.codeplex.com/Wiki/View.aspx?ProjectName=MVPXML> as EXSLT has
> some powerful string manipulation functions too.
Martin Honnen - 21 Mar 2007 13:28 GMT
> I am looking at the XPath 2.0 specs. They came out in 2005.
XPath 2.0 became a W3C recommendation this year:
<http://www.w3.org/TR/xpath20/>

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/