[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Help creating and calling xsl:functions

Subject: Help creating and calling xsl:functions
From: "William Scarvie" <wscarvie@xxxxxxxxxxx>
Date: Fri, 31 Mar 2006 09:45:29 -0800
calling xsl functions
Hi all,

I'm having trouble getting even basic uses of xsl:function to work in my browsers. I'm using this sample code, from http://www.xml.com/lpt/a/2003/09/03/trxml.html:

<xsl:stylesheet version="2.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:foo="http://whatever">

<!-- Compare two strings ignoring case, returning same
values as compare(). -->
<xsl:function name="foo:compareCI">
<xsl:param name="string1"/>
<xsl:param name="string2"/>
<xsl:value-of select="compare(upper-case($string1),upper-case($string2))"/>
</xsl:function>


 <xsl:template match="/">
compareCI red,blue: <xsl:value-of select="foo:compareCI('red','blue')"/>
compareCI red,red: <xsl:value-of select="foo:compareCI('red','red')"/>
compareCI red,Red: <xsl:value-of select="foo:compareCI('red','Red')"/>
compareCI red,Yellow: <xsl:value-of select="foo:compareCI('red','Yellow')"/>
 </xsl:template>

</xsl:stylesheet>

I create a "dummy" XML document, using this stylesheet, as follows:

<?xml version="1.0" ?>

<?xml-stylesheet type="text/xsl" href="fn_test.xsl" ?>

<test_tag>Nothing to see here</test_tag>

When using Firefox 1.5.0.1, I get the following error when I try to open the XML file in the browser:

Error during XSLT transformation: An unknown XPath extension function was called.

When using IE 6.0, I get the following error:

Namespace 'http://whatever' does not contain any functions.

Any idea why I'm not getting function calls to work?

Thanks in advance,

Will

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.