W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > October 2007

Re: Determining whether a pipeline has a (defaulted) output

From: Norman Walsh <ndw@nwalsh.com>
Date: Mon, 01 Oct 2007 14:40:15 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <m2ejgeu19s.fsf@nwalsh.com>
/ Rui Lopes <rlopes@di.fc.ul.pt> was heard to say:
| Norman Walsh wrote:
|> I've already encountered the problem that the harness I wrote for
|> running test pipelines can't tell what inputs and outputs to expect
|> for the pipeline by simply inspecting it.
|
| Could this be solved by specifying algorithms for pipeline inspections
| procedures, and publish them as a WG Note, with accompanying
| pseudo-code/real-code implementation, instead of having to wander
| through XProc's spec prose?

Because I feel like pushing back a little bit on our decision to allow
defaulted pipeline inputs and outputs, I'm going to start by saying
"no". :-)

Consider Richard's pipeline:

<p:pipeline-library xmlns:p="http://www.w3.org/ns/xproc" 
                    xmlns:e="http://example.org" namespace="http://example.org">
<p:pipeline name="pipe1">
  <e:pipe2/>
</p:pipeline>

<p:pipeline name="pipe2">
  <p:choose>
    <p:when test="foo">
      <p:identity/>
    </p:when>
    <p:otherwise>
      <e:pipe1/>
    </p:otherwise>
  </p:choose>
</p:pipeline>

In order to determine if pipe1 has a defaulted output, you need to
know if pipe2 has any outputs. In order to know if pipe2 has any
outputs, you have to determine how many outputs the choose has.
The first branch has 1 output. The second branch has ... well, it
has however many pipe1 has. In order to determine if pipe1 has...

Alternatively, you could say that pipe1 must have one output because
you know that the first branch has one output. But constructing the
algorithm for finding default outputs so that it can be sensitive to
feedback from that point in the analysis is going to be *hard*.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | 'I have done that,' says my memory. 'I
http://nwalsh.com/            | cannot have done that'--says my pride,
                              | and remains adamant. At last--memory
                              | yields.-- Nietzsche

Received on Monday, 1 October 2007 18:40:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:54 GMT