Re: Composability

/ Jeni Tennison <jeni@jenitennison.com> was heard to say:
[...]
| and call this new pipeline in the same way as before:
|
|   <my:matching-documents xmlns:my="http://www.example.com/ns/jeni">
|     <p:option name="test" value="/my:foo[@bar = $bar]" />
|   </my:matching-documents>
|
| The value '/my:foo[@bar = $bar]' is passed as the value of the test
| option to <jt:matching-documents> as a string. But in my pipeline,
| where <p:matching-documents> is called, there's no binding for the
| 'my' prefix, nor for the $bar in-scope option, so the pipeline fails.

Perhaps we should allow options to be passed into called pipelines. At
the moment, it's only forbidden by the special rules for constructing
the p:pipeline environment. We could fix that.

Then, if $bar is in scope for the pipeline that calls
my:matching-documents, it would be in scope for the step that
evaluates it. Options would be passed down.

| If we had the time/will to do something about this, it would mean
| having a way of capturing the namespace bindings and in-scope options
| that are passed through to the pipeline step, and passing them on
| (selectively) to the contained steps. We could do it in the same way
| as I've suggested for parameters, since really it's the same problem.

That's trickier. It doesn't appear to be solvable in the general case:

<p:pipeline name="jt:matching-documents"
  xmlns:jt="http://www.example.com/ns/jeni">
  <p:input port="source" sequence="yes" />
  <p:output port="result" sequence="yes" />
  <p:option name="test" required="yes" />

  <p:option name="mytest" select="$test|my:bar"
            xmlns:my="http://nwalsh.com/ns/norm"/>

  <p:matching-documents>
    <p:option name="test" select="$mytest" />
  </p:matching-documents>
</p:pipeline>

Now this call

<my:matching-documents xmlns:my="http://www.example.com/ns/jeni">
  <p:option name="test" value="/my:foo[@bar = $bar]" />
</my:matching-documents>

can't (practically) be expected to work.

| Personally, I see this as an absolutely fundamental part of building a
| robust, scalable language. But I imagine most people see it as an edge
| case and I'm not going to push it.

Hmm. Perhaps.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | A book is like a garden carried in the
http://nwalsh.com/            | pocket-- (Arabic)

Received on Wednesday, 30 May 2007 15:53:16 UTC