XSLT Component(s) w/ Options

Given Norm's draft, that means we could have an XSLT 1.0 component
definition
of:

<p:declare-step type="p:xslt">
     <p:input port="source" sequence="no"/>
     <p:input port="stylesheet" sequence="no"/>
     <p:output port="result" sequence="yes"/>
     <p:parameter name="*"/>
</p:declare-step>
and and XSLT2 component definition of:

<p:declare-step type="p:xslt2">
     <p:input port="source" sequence="yes"/>
     <p:input port="stylesheet" sequence="no"/>
     <p:output port="result" sequence="yes"/>
     <p:option name="initial-mode"/>
     <p:option name="template-name"/>
     <p:option name="allow-version-mismatch" value="true"/>
     <p:option name="output-base-uri"/>
     <p:option name="allow-collections" value="true"/>
     <p:parameter name="*"/>
</p:declare-step>
Basically, XSLT 1.0 says nothing about transformations are invoked.  As
such, the
APIs I've looked at don't as well.  We might do with no options for XSLT 1.0
.

XSLT 2.0 does say how that can be done and also has the concept of a default

collection.  Given that, I propose:

   * 'initial-mode' sets the invocation's initial mode
   * 'template-name' sets the invocation's named template name
   * 'allow-version-mismatch' indicates whether the user will allow
     an XSLT 2.0 processor to run an XSLT 1.0 transformation.
   * 'output-base-uri' is a base URI value that should be associated
     with the result.
   * 'allow-collections' indicates whether a sequence on the 'source'
     port will construct the default collection.  If the value is 'false',
     the component fails at runtime if there is more than one document
     on 'source'

One nice thing about having options is that you don't need a
namespace for the option name.

-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Friday, 2 March 2007 18:39:21 UTC