RE: The meaning of <p:input/>

Hi,

This is what V1 says about <p:input/> and the default connections in 5.1 (p:input):

"An input declaration may include a default connection. If no connection is provided for an input port which has a default connection, then the input is treated as if the default connection appeared."
"If no connection is provided for a primary input port, the input will be connected to the default readable port. It is a static error (err:XS0032) if no connection is provided and the default readable port is undefined."
"A default connection does not satisfy the requirement that a primary input port is automatically connected by the processor, nor is it used when no default readable port is defined. In other words, a p:declare-step or a p:pipeline can define defaults for all of its inputs, whether they are primary or not, but defining a default for a primary input usually has no effect. It's never used by an atomic step since the step, when it's called, will always connect the primary input port to the default readable port (or cause a static error). The only case where it has value is on a p:pipeline when that pipeline is invoked directly by the processor. In that case, the processor must use the default connection if no external connection is provided for the port."

The last paragraph actually took me by surprise and I wonder if our XProc implementation implements the default connections correctly. I also can't find what happens with non-primary inputs with no connections (err:XS0032?).

Anyway, if the WG wants to change/clarify the meaning of <p:input/>, I think we could do the following:

- In the absence of p:input, a default connection is used (if available) or, in the case of a primary input port, the default readable port. [Consistent with V1]
- If <p:input/> is used, then, for symmetry with p:output in compound steps, we could say:
  - Primary input port connects to the default readable port, otherwise an error. [Consistent with V1]
  - Non-primary input port connects to an empty sequence. [Change from V1]

So effectively, <p:input/> disables the default connection.

Regards,
Vojtech

-----Original Message-----
From: Norman Walsh [mailto:ndw@nwalsh.com] 
Sent: Wednesday, June 10, 2015 7:44 PM
To: public-xml-processing-model-wg@w3.org
Subject: The meaning of <p:input/>

Folks,

At today's f2f, we discussed the meaning of <p:input/>. The nominated options were, it's the same as:

  <p:input>
    <p:pipe/>
  </p:input>

i.e., a binding to the default readable port (per discussed but not yet implemented changes to p:pipe), or:

  <p:input>
    <p:empty/>
  </p:input>

Unfortunately, I don't think it's that simple, because:

  "An input declaration may include a default connection. If no
  connection is provided for an input port which has a default
  connection, then the input is treated as if the default connection
  appeared."

I wonder if default connections are worth the trouble.

                                        Be seeing you,
                                          norm

--
Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 512 761 6676
www.marklogic.com

Received on Thursday, 11 June 2015 06:35:12 UTC