Re: Extension functions

On 5/23/07, Norman Walsh <ndw@nwalsh.com> wrote:
> / Alex Milowski <alex@milowski.org> was heard to say:
> | On 5/23/07, Norman Walsh <ndw@nwalsh.com> wrote:
> |> Anyone disagree?
> |
> | Partially.
> |
> | I don't see any value in exposing in-scope *options* as variable bindings
> | as our use of options and their values aren't going to help select
> | content.
> |
> | I could see exposing in-scope *parameters* as variable bindings as
> | long as in-scope parameters means those parameters calculated
> | for the compound step's contained steps.
>
> We can't possibly expose *options* as variables in XProc
>
>    <p:option name="output-method" select="$output-method"/>
>
> and *parameters* as variables in steps. That would be insane!

I didn't suggest that and so, whew, I'm not insane!

> If you want to argue that we don't need to expose *any* variable
> bindings in steps, I guess you could make that argument, but it
> seems pretty hard to explain.
>
> Why can I say
>
>    <p:option name="output-method" select="$output-method"/>
>
> when I can't say
>
>    <p:option name="match" value="//foo[@bar = $bar-value]"/>

I give up.  This is just too bizarre. :(

I think XSLT avoided this nightmare by providing variables and parameters.
The share the same "variable space" and so you can use them equally
in XPath expressions.

They also didn't make a distinction between options-as-parameters and
parameters-as-parameters.  Of course, XSLT doesn't have some
of the complexities that we have.

In the end, we've made parameters something that only get passed to
things like XSLT steps.  That means a pipeline invocation could radically
change the outcome of the pipeline by setting the right "magic" parameter.
That seems like an unwanted consequence.

In the case of options, you have to author them into the pipeline and a
simple inspection will tell you the names.  You can then use them in
parameter expressions and so you can use options to control
parameter binding.  That means a careful pipeline author would
bind locally all the parameters to an XSLT transform and make them
options on the pipeline and then no magic "hidden" switches can occur.

It still leaves me with the thought: "strange".

...but I still cry "Uncle" and so I'm not disagree with Norm now.

-- 
--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 Wednesday, 23 May 2007 20:57:11 UTC