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

Re: xsl:function

Subject: Re: xsl:function
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 12 Sep 2007 09:00:24 +0200
Re:  xsl:function
I just completed your code bit and changed the obvious xsl:result error into xsl:value-of. But that was not the error you got. I ran it, and it put out "2".

<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:my="http://whatever" exclude-result-prefixes="my">
<xsl:function name="my:one">
<xsl:param name="a"/>
<xsl:param name="b"/>
<xsl:value-of select="$a+$b"/>
</xsl:function>
<xsl:template match="/">
<xsl:value-of select="my:one(1,1)"/>
</xsl:template>
</xsl:stylesheet>


What I think is that you accidentally ran an XSLT 2.0 stylesheet with an XSLT 1.0 processor (which should already complain about the xsl:function instruction, but perhaps first throws an error about the extension functions not being known. Saxon for instance says there's no known java function).

Cheers,
-- Abel Braaksma

Karanam.Chowdary@xxxxxxxxxxxxxxxxxx wrote:
The error is "Namespace http://whatever doesn't contain any functions"

-----Original Message-----
From: Abel Braaksma [mailto:abel.online@xxxxxxxxx] Sent: Wednesday, September 12, 2007 12:14 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: xsl:function


Karanam.Chowdary@xxxxxxxxxxxxxxxxxx wrote:
Hello,
I m very new to XSL and XML just strtd working 10 days back.
I hv a problem in using <xsl:function>. What's the name space to be
given? Shud I give a valid name space which contains the functions?


<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:my="http://whatever" exclude-result-prefixes="my">
<xsl:function name="my:one">
		<xsl:param name="a"/>
		<xsl:param name="b"/>
		<xsl:result select="$a+$b"/>
</xsl:function>
	
<xsl:template match="/">
<xsl:value-of select="my:one(1,1)"/>
.......
What is the mistake here? Am I missing sumthing?

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.