[xslt] XSLT conformance issues



Hi,

This message is only related to the extension framework (see [14.
Extensions] in [XSLT]).

Issue ext1:
  libxslt doesn't differenciate top-level elements from instructions, so
  element-available() is broken (returns true even if an element isn't an
  instruction)

  Resolution:
  Extend the framework to register top-level elements.
  int xsltRegisterExtTopLevelElement (xsltTransformContextPtr ctxt,
                                      const xmlChar *name,
                                      const xmlChar *URI,
                                      xsltTransformFunction function);

Issue ext2:
  non-XSLT top-level elements are totally ignored.

  Resolution:
  Just before any transformation, the processor should go through them,
  search for registered top-level elements and call their specific
  function.
  [NOTE: extension-element-prefixes doesn't apply to top-level elements]

Issue ext3:
  extension functions that are part of extension modules must be
  registered in the xsltExtInitFunction callback. This function is
  called only if the prefix is declared an extension-element-prefix.
  Thus extension functions are available only if their prefix is
  declared an extension-element-prefix, which doesn't conform to [14.2
  Extension Functions]
  Like top-level elements, extension functions are available as soon as
  their namespaces are _declared_, no need to declare them as extensions.

  Resolution:
  Add a function lookup framework to libxml/XPath similar to the
  variable lookup already available.
  libxslt then search for extension functions in its global hash table.
  typedef xmlXPathFunction
          (*xmlXPathFunctionLookupFunc)   (void *ctxt,
                                           const xmlChar *name,
                                           const xmlChar *ns_uri);
  void    xmlXPathRegisterFunctionLookup  (xmlXPathContextPtr ctxt,
                                           xmlXPathFunctionLookupFunc f,
                                           void *funcCtxt);

These changes shouldn't break anything I guess...

I'll try to implement all that stuff this evening or tomorrow.

Tom.




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