1.1 --- a/XSLForms/Resources/WebResources.py Mon Oct 31 23:55:38 2005 +0000
1.2 +++ b/XSLForms/Resources/WebResources.py Mon Oct 31 23:55:51 2005 +0000
1.3 @@ -197,11 +197,13 @@
1.4 expressions=stylesheet_expressions, references=references)
1.5 return proc.get_result(document)
1.6
1.7 - def prepare_initialiser(self, input_identifier):
1.8 + def prepare_initialiser(self, input_identifier, init_enumerations=1):
1.9
1.10 """
1.11 Prepare an initialiser/input transformation using the given
1.12 - 'input_identifier'.
1.13 + 'input_identifier'. The optional 'init_enumerations' (defaulting to
1.14 + true) may be used to indicate whether enumerations are to be initialised
1.15 + from external documents.
1.16
1.17 Return the full path to the input stylesheet for use with 'send_output'
1.18 or 'get_result'.
1.19 @@ -210,7 +212,7 @@
1.20 template_filename, input_filename = self.init_resources[input_identifier]
1.21 input_path = os.path.abspath(os.path.join(self.resource_dir, input_filename))
1.22 template_path = os.path.abspath(os.path.join(self.resource_dir, template_filename))
1.23 - XSLForms.Prepare.ensure_input_stylesheet(template_path, input_path)
1.24 + XSLForms.Prepare.ensure_input_stylesheet(template_path, input_path, init_enumerations)
1.25 return input_path
1.26
1.27 def prepare_transform(self, transform_identifier):
2.1 --- a/XSLForms/XSL/Input.xsl Mon Oct 31 23:55:38 2005 +0000
2.2 +++ b/XSLForms/XSL/Input.xsl Mon Oct 31 23:55:51 2005 +0000
2.3 @@ -26,6 +26,10 @@
2.4
2.5
2.6
2.7 + <xsl:param name="init-enumerations">yes</xsl:param>
2.8 +
2.9 +
2.10 +
2.11 <!-- Match the document itself. -->
2.12
2.13 <xsl:template match="/">
2.14 @@ -34,9 +38,11 @@
2.15 <axsl:output indent="yes"/>
2.16
2.17 <!-- Make document parameters for all elements appearing to use enumerations. -->
2.18 - <xsl:for-each select="//element[@type='multiple-choice' or @type='multiple-choice-list']">
2.19 - <axsl:param name="{@name}"/>
2.20 - </xsl:for-each>
2.21 + <xsl:if test="$init-enumerations = 'yes'">
2.22 + <xsl:for-each select="//element[@type='multiple-choice' or @type='multiple-choice-list']">
2.23 + <axsl:param name="{@name}"/>
2.24 + </xsl:for-each>
2.25 + </xsl:if>
2.26
2.27 <!-- Make a document-level rule. -->
2.28 <axsl:template match="/">
2.29 @@ -99,9 +105,12 @@
2.30 <xsl:choose>
2.31 <!-- Enumerations. -->
2.32 <xsl:when test="@type='multiple-choice-value' or @type='multiple-choice-list-value'">
2.33 - <xsl:call-template name="inside-enumeration">
2.34 - <xsl:with-param name="path" select="concat($path, '/', @name)"/>
2.35 - </xsl:call-template>
2.36 + <!-- Only generate enumerations if requested. -->
2.37 + <xsl:if test="$init-enumerations = 'yes'">
2.38 + <xsl:call-template name="inside-enumeration">
2.39 + <xsl:with-param name="path" select="concat($path, '/', @name)"/>
2.40 + </xsl:call-template>
2.41 + </xsl:if>
2.42 </xsl:when>
2.43 <!-- Added elements. -->
2.44 <xsl:when test="(not(@init) or @init = 'auto') and $adding-selectors = 0 or @init = 'yes'">