Yes, it's a nice idea, but if you want to implement this you'll have to do some poking around very deep in the saxon source code.
Michael Kay
-----Original Message-----
From: [] On Behalf Of Ytai Ben-Tsvi
Sent: 04 August 2002 16:09
Subject: [saxon] Extension elements inplemented in XSLT


I want to implement an extension element that’s similar to the exslt:function element, only for extension elements (something like macros). I’ve implemented extension elements and functions before successfully, but what I don’t know is when my extension element is parsed – how do I tell saxon to register a NEW extension element dynamically. I tried looking at the code for exslt:function, and couldn’t quite figure out in what stage is the function registration done, and whether it is the same for extension elements.


Here’s an example for why it can be useful:


<ext:new-extension name=”ext:error”>

            <xsl:param name=”text”/>

            <xsl:message termainate=”true”>

                        Error: <xsl:value-of select=”$text”/> on line <xsl:value-of select=”saxon:lineNumber()”/>






<xsl:if test=”something is wrong”>

            <ext:error text=”Something is wrong”/>




It just seems logical to me that if it’s possible to implement extension functions in XSLT, it should be possible to implement extension elements as well.



Ytai  Ben-Tsvi

C T I Squared