If you write transforms against system.xml (.net framework), you'll find
that you can write inline extension functions in C#, using the
msxsl:script approach.
You can also register extension objects, which you can reference in your
transform. These objects are not inline, but compiled code outside of
your transform. I believe that these objects can be written in any
CLS-compliant language, such as C#, VB.Net, J#, managed C++, cobol.net
(I think that there is such a thing) ...
I believe that the latter approach is more parallel to your approach.
Rich
-----Original Message-----
From: Jeni Tennison [mailto:jeni(_at_)jenitennison(_dot_)com]
Sent: Friday, October 11, 2002 7:22 AM
To: Vedu Hariths
Cc: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Hi Vedu,
This is how my code looks (copied and pasted from
Michael Kay's book, pg 100)
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:Date="java:java.util.Date">
<xsl:script implements-prefix="Date" language="java"
src="java.util.Date" />
<xsl:variable name="Date"
select="Date:to-string(Date:new())" />
</xsl:stylesheet>
See the 'version' attribute on the <xsl:stylesheet> element? It
specifies version 1.1 of XSLT. Version 1.1 of XSLT was a Working Draft
that got halted so that attention could be focused on XSLT 2.0
instead. There are only a couple of processors that implemented the
XSLT 1.1 Working Draft (Saxon and jd.xslt); most processors, including
MSXML3 (the processor that IE6 uses) didn't implement it.
IE6 *does* support a different way of defining extension functions
using <msxsl:script>, but it doesn't support defining them using Java.
Instead, you have to write some JavaScript or VBScript to implement
the function. Have a look at page 134 of Mike's book for an example.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list