Re: [xslt] Extension module initialization is called for every imported stylesheet



Hello,

On Tue, 2 May 2006 17:18:59 -0400
Daniel Veillard <veillard redhat com> wrote:

> On Tue, May 02, 2006 at 09:31:40PM +0200, Buchcik, Kasimier wrote:
> > Hi,
> > 
> > Extension module initialization functions will be called
> > once for every imported stylesheet (plus the main stylesheet).
> > The initialization function is the "xsltStyleExtInitFunction"
> > argument of the xsltRegisterExtModuleFull() function.
> > Is this the intended design? I.e., is the initialization
> > expected to be called for *every* imported stylehsheet and not
> > only once for a whole stylesheet compilation episode?

As far as I remember, more precise behaviour is the following.
Initialization is expected for every (imported or main) stylesheet which
has the corresponding "extension-element-prefixes".

> 
>   It's probably an oversight, once per stylesheet should be sufficient.

Do you mean "once per the whole stylesheet"? I think it is not sufficient.

I have a chain of imported xslt-files that looks like:

-- [code]
<x:stylesheet extension-element-prefixes="myx" ...>

<myx:init>...</myx:init>

...

</x:stylesheet>
--- [/code]

When my xsltStyleExtInitFunction is activated, it looks for "myx:init" and
performs additional initialization for the corresponding xslt file. If the
function were called only once, I'd have problems to locate all "myx:init"
in all xslt files.

> 
> Daniel
> 



-- 
Oleg Parashchenko  olpa@ http://xmlhack.ru/  XML news in Russian
http://uucode.com/blog/  Generative Programming, XML, TeX, Scheme


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]