Re: [xslt] extension modules



Le 21/07/01 22:43:49, Daniel Veillard a écrit :
> > This version is the most complete one, the one I'd like to have. I'll
> > send another message for a stripped-down version not including
> > precomputation, and a third one for an alternative, based on the
> > current extension API.
> 
>   Since you're the one doing the job, and that nobody objected
> to any of the proposed solutions, I suggest you go ahead with the
> one you like the most (the more you like the solution the better the
> code will be :-)

OK, that's mostly done.

Here's a list of some of the changes:
  · added an extInfos field to xsltStylesheet for stylesheet module data
  · added the couple of stylesheet data init/shutdown functions to
    xsltExtModule (this is a private struct)
    and a function xsltRegisterExtModuleFull that receives these 4
    functions
  · added xslt{Register,Unregister}ExtModule{Function,ElementTopLevel}
    and xsltExtModule{Function,Element,ElementPreCompute,TopLevel}Lookup
  · added function lookup framework to libxml/XPath and used it in libxslt
    and modified the extension element lookup in the same way (look for
    the element in the context, then in the global registry)
  · modified xsltGetExtData to initialize the module when needed and
    added xsltStyleGetExtData for the stylesheet data
  · modified xsltInitCtxtExts to do the automatic initialization of
    modules with stylesheet data (and do not care about
    extension-element-prefixes)
  · modified xsltParseTemplateContent to be independant of xsltTemplate
    and made it public: extension elements may need it (func:function do)
    to precompute their contents.
  · modified xsltPrecomputeStylesheetTop to precompute top-level elements

What's still needed:
  · correct handling of extension-element-prefixes and
    exclude-result-prefixes. extension-element-prefixes may need binding
    data to the _private field of *every* element node (even literal
    result elements)
  · actually do extension element precomputation
  · test, test and test again...

With these changes, I already succeeded in making EXSLT - Functions to work
correctly (or at least it *seems* to work correctly)

I also found (and fixed) some bugs (in xsltPrintErrorContext, the first
test was (node != NULL) instead of (node == NULL), and -- according to the
DTD fragment in Appendix C of the XSLT spec, which clarifies a bit the
prose -- "foreign top-level elements" are not allowed before xsl:import
elements [libxslt currently just ignores them])

Tom.




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