Hi,

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:message>

</ext:new-extension>

.

.

.

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

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

</xsl:if>

 

 

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