Select Parameters Utility

The Select Parameters Utility helps you create dynamic web pages. You can use it to let users of your webpages select the parameters that they want to apply within the stylesheet.

Instructions

  1. Download the selectParameters.xsl stylesheet into the same directory as your stylesheet.
  2. Import the selectParameters.xsl stylesheet into your stylesheet:

    <xsl:import href="selectParameters.xsl" />
  3. Call the template 'insert-selectParameters-form' at the point where you want to insert the form that allows the users to select parameter values:

    <xsl:call-template name="insert-selectParameters-form" />
  4. Add the 'doc' namespace to your stylesheet as an extension prefix:

    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:doc="http://www.jenitennison.com/xslt/doc"
                    extension-element-prefixes="doc">
    
  5. Add documentation to your stylesheet to limit the values that users can select for the parameters:

    <doc:param name="function">
      <doc:label>Function: </doc:label>
      <doc:choice><doc:value>concat</doc:value><doc:choice>
      <doc:choice><doc:value>starts-with</doc:value><doc:choice>
      <doc:choice><doc:value>contains</doc:value><doc:choice>
      <doc:choice><doc:value>substring-before</doc:value><doc:choice>
      <doc:choice><doc:value>substring-after</doc:value><doc:choice>
    </doc:param>
    

There are five options that you can set as parameters for the 'insert-selectParameters-form' template, namely:

$xml-file
the default xml file
$xsl-file
the default stylesheet
$choose-xml-file [= false]
$choose-xsl-file [= false]
$lang [= 'en']
the language that the labels for the input fields should be shown in

More Information


/xslt/utilities/selectParameters.xml by Jeni Tennison; generated using SAXON 6.5 from Michael Kay