all groups > dotnet xml > march 2007 >
You're in the

dotnet xml

group:

Referencing Additional Namespaces XSL


Referencing Additional Namespaces XSL SR
3/20/2007 12:09:56 PM
dotnet xml:
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

Re: Referencing Additional Namespaces XSL SR
3/20/2007 2:02:15 PM
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.

[quoted text, click to view]

Re: Referencing Additional Namespaces XSL Martin Honnen
3/20/2007 6:16:54 PM
[quoted text, click to view]

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.





--

Martin Honnen --- MVP XML
Re: Referencing Additional Namespaces XSL Martin Honnen
3/21/2007 1:28:01 PM
[quoted text, click to view]

XPath 2.0 became a W3C recommendation this year:
<http://www.w3.org/TR/xpath20/>

--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button