Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / March 2007

Tip: Looking for answers? Try searching our database.

Referencing Additional Namespaces XSL

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SR - 20 Mar 2007 18:09 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'.

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/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.