What can a step implementation ask the pipeline processor?

Consider the matching-documents use case:

  <p:matching-documents>
    <p:option name="test" value="p:document-position() mod 1 == 0"/>
  </p:matching-documents>

Clearly the step has to be able to evaluate p:document-position().
And if we allow steps to "reach back" into the processor to evaluate
p:document-position(), I don't see any reason to forbid them from
evaluating p:episode(). (And I don't think we need the index function
anymore[1])

What about this example:

  <p:matching-documents>
    <p:option name="test" value="/*/@root = $opt"/>
  </p:matching-documents>

Again, the step has to evaluate that expression for each document so,
in principle, it has to be able to access the in-scope options.
But in fact, we don't have to allow that. Because options cannot change
during the course of an atomic step, we could say that users instead
have to write:

  <p:matching-documents>
    <p:option name="test" select="concat('/*/@root = &quot;', $opt, '&quot;')"/>
  </p:matching-documents>

This would allow the pipeline processor to fill in the value for $opt.
Unfortunately, the whole &quot; thing is pretty awful (even more so if
$opt happens to contain either kind of quote; and impossible, I think,
if it contains both). The tempatation for users will be to write

  <p:matching-documents>
    <p:option name="test" select="concat('/*/@root = ', $opt)"/>
  </p:matching-documents>

which isn't going to do what they expect.

I dunno. On the one hand, requiring implementors to support access to
all the in-scope options *and* extension functions seems kind of
painful.

On the other hand, I didn't actually experience very much pain
implementing it. :-)

                                        Be seeing you,
                                          norm

[1] http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2007May/0228.html

-- 
Norman Walsh <ndw@nwalsh.com> | Almost every man wastes part of his
http://nwalsh.com/            | life in attempts to display qualities
                              | which he does not possess, and to gain
                              | applause which he cannot keep.--Dr.
                              | Johnson

Received on Wednesday, 16 May 2007 12:01:20 UTC