Subject: Re: xsl:function
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 28 Mar 2003 21:12:53 +0000
|
Hi Mac,
> Yup, very confused. So, here is the bare bones xsl that I am trying.
> I'm using the msxml 4.0 processor. There are no files located at
> http://magusdesigns.com/namespace. It's sounds like there don't need
> to be any file there, right?
You're defining the functions with <func:function> from EXSLT. MSXML
doesn't support any EXSLT extension functions or elements, so it
simply doesn't recognise <func:function> and therefore doesn't create
a function definition in the way a processor that *does* recognise
<func:function> would.
If you want to create a user-defined function in MSXML, you have to
use <msxsl:script> and write the function in
JavaScript/VBScript/JScript. For example:
<xsl:stylesheet version="1.0"
xmlns:my="http://magusdesigns.com/namespace"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<msxsl:script language="JScript" implements-prefix="my">
function test() {
return 1;
}
</msxsl:script>
<xsl:template match="/">
<xsl:value-of select="my:test()" />
</xsl:template>
</xsl:stylesheet>
Alternatively, you can use a processor that does support
<func:function> such as Saxon, Xalan, 4XSLT or libxslt.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- match attribute values, (continued)
- Mac Martine - Thu, 27 Mar 2003 16:04:29 -0500 (EST)
- Mac Martine - Fri, 28 Mar 2003 13:44:43 -0500 (EST)
- Michael Kay - Fri, 28 Mar 2003 14:36:46 -0500 (EST)
- Mac Martine - Fri, 28 Mar 2003 15:19:17 -0500 (EST)
- Jeni Tennison - Fri, 28 Mar 2003 16:09:35 -0500 (EST) <=
- Mac Martine - Fri, 28 Mar 2003 17:22:56 -0500 (EST)
- Michael Kay - Sat, 29 Mar 2003 04:36:07 -0500 (EST)
- Oleg Tkachenko - Sun, 30 Mar 2003 02:27:16 -0500 (EST)
- bryan - Thu, 27 Mar 2003 04:01:32 -0500 (EST)
|
|