[xslt] Module initialization with built-in user-defined data elements "meta" and "initialize-module"


In order to eliminate module initialization based on
namespaces defined via "extension-element-prefixes",
I'm thinking of adding a built-in user-data element "meta"
(in conjunction with the element "initialize-module")
to control Libxslt's module initialization.

Here's what I currently have in mind:

<xsl:stylesheet version="1.0"

  <!-- The new meda data element of Libxslt. -->
  <meta xmlns="http://xmlsoft.org/XSLT/";>
      Initialize the module "urn:test:myTest" at compile-time.
      The attribute @scope can be one of:
      1) "global" - global storage of user-data for this module
      2) "stylesheet-level" - per stylesheet-level storage of
                              user-data for this module
    <initialize-module namespace="urn:test:myTest" scope="global"/>

  <xsl:template match="/">
      If the extension function needs access to user-data of the
      module, then it could either initialize the module during
      execution, which should be avoided, since it will modify
      the stylesheet during transformation-time (leading to
      race conditions), or Libxslt's module initialization user-data
      element "meta" can be used to initialize the module at
    <foo bar="{my-test:my-ext-func()}" />

Comments and further ideas are appreciated.

1) Are the element names OK? intuitive enough?
2) Do we need to specify more information than the "namespace"
   and data-storage "scope"?
3) What about dynamic modules? Do we need something for them?



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